Character Movement

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

Hello,

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.

 

Developer
Mar 27, 2010 at 8: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 8: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 :)