What's wrong with this code

it tells me that its incorrect

extends CharacterBody2D

const speed = 100

func _physics_process(delta):

func player_movement(delta):

if input.is_action_just_pressed(ui_right):
	velocity.x = speed 
	velocity.y = 0
	elif input.is_action_just_pressed(ui_left):
	velocity.x = -speed 
	velocity.y = 0
	if input.is_action_just_pressed(ui_down):
	velocity.x = speed 
	velocity.y = 0
	elif input.is_action_just_pressed(ui_up):
	velocity.x = -speed 
	velocity.y = 0
	velocity.x = 0
	velocity.y = y 

GDScript is case sensitive. Use Input, not input.

oh i will try that now

Thank you it worked

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.