Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Mehmet Ozbagci |
I’m working on a platformer game. To avoid character incurs more effort going up slopes than it does going down I used RayCast Shapes as Collision Shape. But i try go down from a hill my character starts tp fall as you can see here:
I tried to increse snap vector but it didnt worked… My movment code is here:
const SNAP_VECTOR = Vector2(0,6)
export var GRAVITY_VECTOR = Vector2(0, 600)
export var WALK_SPEED = 75
export var RUN_SPEED = 120
velocity.x = lerp( velocity.x, target_x ,0.1)
velocity += delta * GRAVITY_VECTOR
velocity = move_and_slide_with_snap(velocity,SNAP_VECTOR, Vector2.UP, true)