title: Player slides ramps in godot
body: <p>So im developing this 3D based topdown game in Godot 3.3.4. I've wrote some code for the player movement but it causes the player to slowly slide while standing on ramps.</p>
  <p><a href="https://i.stack.imgur.com/JWndv.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JWndv.gif" alt="enter image description here" /></a></p>
  <p>I kinda can imagine how to fix it but I think im over engineering a prety simple fix, so im asking the comunity. Is there a simple way to make the player stay on place while touching groud?</p>
  <p>(Im aware of move_and_slide_with_snap() method but i couldn't make it work correctly either)
  (im also aware i forgot aplying delta)</p>
  <p>Here's the code:</p>
  <blockquote>
  <pre><code>export var speed = 7.5
  const GRAVITY = Vector3.DOWN * 100
  
  var velocity = Vector3.ZERO
  
  func _physics_process(delta):
    velocity += GRAVITY * delta
    velocity = move_and_slide(velocity, Vector3.UP)
    
    var input_vector = Vector2.ZERO
    input_vector.x = Input.get_action_strength(&quot;ui_right&quot;) - Input.get_action_strength(&quot;ui_left&quot;)
    input_vector.y = Input.get_action_strength(&quot;ui_down&quot;) - Input.get_action_strength(&quot;ui_up&quot;)
    input_vector = input_vector.normalized()
    
    velocity.x = input_vector.x * speed
    velocity.z = input_vector.y * speed
    
  
    move_and_slide(velocity)
  </code></pre>
  </blockquote>
  <p>This is my first community ask so hi and thank u.</p>
  <h1>Solved</h1>
  <p>I got some gifs but apparently u need 10 rep and im new so...</p>
  <p><a href="https://i.stack.imgur.com/CRwIJ.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CRwIJ.gif" alt="enter image description here" /></a></p>
  <p>Thank you Theraot, i've enabled the slope thing but than just worked sometimes. So I've made some changes and i think im okay with this:</p>
  <p><a href="https://i.stack.imgur.com/JSo7o.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JSo7o.gif" alt="enter image description here" /></a></p>
  <pre><code>
  extends KinematicBody
  
  export var speed = 750
  const GRAVITY = Vector3.DOWN * 10
  
  var velocity = Vector3.ZERO
  
  func _physics_process(delta):
      velocity += GRAVITY * delta
      velocity = move_and_slide_with_snap(velocity, Vector3.DOWN, Vector3.UP, true, 1, 0.80)
      
      var input_vector = Vector2.ZERO
      input_vector.x = Input.get_action_strength(&quot;ui_right&quot;) - Input.get_action_strength(&quot;ui_left&quot;)
      input_vector.y = Input.get_action_strength(&quot;ui_down&quot;) - Input.get_action_strength(&quot;ui_up&quot;)
      input_vector = input_vector.normalized()
      
      velocity.x = input_vector.x * speed * delta
      velocity.z = input_vector.y * speed * delta
      
  
      move_and_slide_with_snap(velocity, Vector3.DOWN, Vector3.UP, true, 0, 0.785398)
  
  
  
  </code></pre>
  <p>Im shure that code is pretty much to work on but the movement is okey and it only slides a bit on big ramps so that can be a &quot;fun&quot; thing.</p>
  <p>Im closing this but if somebody want to correct that code im okay with it. Have fun.</p>