Re: Constant speed in the X axis of a body
Posted: Mon Nov 16, 2015 7:17 am
First:
Thanks to all who helped!
Second:
Thanks to all who helped!
Second:
Try to duplicate your example, but I could not, you could guide me more? Sorry!S0lll0s wrote:Not really, he just needs to do a few things every frame:Doctory wrote:switch from the love.physics, it is impossible to get a constant velocity in love.physics without screwing something upNow you can either just set it directly (setLinearVelocity()), which might look weird, or instead apply a force:
- get current velocity vector (:getLinearVelocity())
- normalize and scale it by the target velocity
- subtract the actual velocity from the target velocity vector
- apply a force proportional to that difference