#Sliding up slopes 2D with characterbodys.

7 messages · Page 1 of 1 (latest)

chilly totem
#

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?

tawdry minnow
#

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.

chilly totem
#

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

chilly totem
leaden tapir
#

Are you using move and collide or move and slide?

chilly totem
leaden tapir
#

In your explanation you mention that the penguin loses speed too fast? So it manages to slide a little bit?