I’m working on a penguin game that is about sliding on slopes on the penguins belly but every time the player tries to slide up a slope all the vertical velocity is killed. The downward acceleration is working but the upper deceleration is WAY too high. I’ve tried changing friction and even disabled gravity but the penguin refuses to slide of the slope. What do I do?
#Sliding up slopes 2D with characterbodys.
7 messages · Page 1 of 1 (latest)
Have you tried adjusting the player's inertia?
Also, we don't know anything about how you're calculating the physics, so posting those parts of your code would help.
at the current moment I am trying use velocity += Vector2(-10*sin(get_floor_angle())cos(get_floor_angle()),10sin(get_floor_angle())*sin(get_floor_angle())) however get_floor_angle() only returns a positive number so I can't tell is the slope is pointing up or down causing the penguin to slide close to what I want but only on slopes angled up
I might be able to use get_angle_normal to work with this. I will try tomorrow
Are you using move and collide or move and slide?
Move and slide
In your explanation you mention that the penguin loses speed too fast? So it manages to slide a little bit?