# Player Movement

This topic is 1699 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

i've got the following Problem:

im making a 2D not Tile-Based game with Collision Lines in all directions and sizes. Now when the Player moves along a 40 degree Line for example, his movment speed decreases dramaticaly, so i set down the Gravity. but then if the player moves in the opposite direction, he flies of the surface.

How could i solve thies Problem?

I thought about implementing a System, that, if the player is on a surface, lets him move along the surface, but that caused me a lot of other problems. How do other People solve this kind of Problem?

##### Share on other sites

You say that you have gravity - is it a top-down view or a side view? How is the gravity affecting your movement?

Can you be a bit more specific on how you currently calculate your movement?

##### Share on other sites

its top down and the gravity is alawys 1m/s, so the player is always falling, but the player gets on the surface by resolving the collision. Movement is 1 m/s right now which means the effect drops by 45 degrees.

##### Share on other sites

How do you resolve the collision?

Lets say the player is penetrating a plane.

If you push the player out in direction of the plane normal it should slide down slopes on its own, which is probably not what you want.

If you push the player out vertically, it will stay in position and gravity should also not affect the movement speed.

##### Share on other sites

i avoided the sliding by adding fraction

so your telling me top just resolving the collision vertically or horizontal?

k ill try it out