Hi all,
How do I limit the speed of my character?
I am doing as below, but it forces my Y-Velocity to be 0 because I can’t find any functions to set just the X-Velocity. This means when the object is supposed to fall, it doesn’t.
if(playerTopSpeed \< playerVelocityX) then
player:applyForce(100, 0, player.x, player.y);
else
player:setLinearVelocity(playerTopSpeed, 0, player.x, player.y);
end
Is there a better way to move a character in a constant speed without diminishing the physics?
I did X = X + 1, but the collisions don’t work well with that.
Thanks. [import]uid: 75783 topic_id: 12466 reply_id: 312466[/import]
