–1 vote

Hi Guys,

i have a wired problem with move and slide. i created a video where you see it:

thats my kinematik code:

extends KinematicBody2D

const ACCELERATION = 1000;
const MAX_SPEED = 300

const FRICTION = 1300
var velocity = Vector2.ZERO

func _physics_process(delta):
    var input_vector = Vector2.ZERO
    input_vector.x = Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")
    input_vector.y = Input.get_action_strength("ui_down") - Input.get_action_strength("ui_up")
    input_vector = input_vector.normalized()

if not input_vector == Vector2.ZERO:
    velocity = input_vector * MAX_SPEED 
    velocity = Vector2.ZERO
velocity = move_and_slide(velocity)

I dont know how to solve that issue

Godot version v3.2.3.stable.official
in Engine by (68 points)
reshown by

looks ok, and works on my pc. maybe the problem is somewhere else?

Hi thank you for your answer.
well thats the only script in my project so far. and i have only the problem with the capsuleShape2d

is the scale of all nodes (1.0, 1.0)?
i tried to replicate your scene and have absolutly no problem.

you are genius.
the collisionshape was scaled instead of changed width and height.

when i resetted the scale, everything works as supposed :)

thank you very much :)

Kein ding ;)

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.