0 votes

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:

enter image description 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)

in Engine by (12 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.