I already checked the console to see if it was registering the input, it is. I can't figure out why it won't move.
extends Node2D
const WALK_SPEED = 5000
var velocity = Vector2(0,0)
func walk():
if Input. is_action_pressed("Walk_Up"):
velocity.y -= WALK_SPEED
print("debug up")
func _physics_process(delta):
walk()
It is supposed to move the sprite when I press W but nothing is happening other then the text I put in that print statement appearing in the console.
Also Node2D is just the name of the kinematic body I didn't change it from when I changed the type.
You are setting the velocity but not calling anything that would use it.
A kinematic body can be moved by setting the velocity and calling one of
move_and_collide()ormove_and_slide(), as spelled out in the docs.Call either of the two after your
walk()function: