This project has moved and is read-only. For the latest updates, please go here.

Character Movement

Topics: User Forum
Mar 27, 2010 at 5:21 PM


I'm having trouble setting up the environment in my platformer game (think sonic).

I'm using 100 Y gravity and character mass is 15. When the player presses the Right arrow key, the character is applied force to its X axis. This gets the character moving but the character often floats of the platform when going down slopes. How can I fix this?

I tried higher gravity and mass but then movement gets difficult and if i raise the force applied, the same thing happens.


Mar 27, 2010 at 9:01 PM

You could try applying a downward force at the same time you are applying the force to the X axis. Also it's not uncommon to have very high values in the 2.x version of the engine. This is due to the fact that it uses a pixel based scale. I might try 250 for the gravity and decrease the mass of the player to 5 or 10. Then increase your X axis force. Try this and see what happens.


Mar 27, 2010 at 9:18 PM

I used "ApplyAngularImpulse" to move the character. It works best because the character is a circle.

I'll keep your advice in mind though, thanks :)