![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | deezy |
extends KinematicBody2D
var velocity = Vector2()
# warning-ignore:unused_argument
func _physics_process(delta):
velocity.y += 0
if Input.is_action_just_pressed("ui_right"):
velocity.x = 100
elif Input.is_action_just_pressed("ui_left"):
velocity.x = -100
else:
velocity.x = 0
# warning-ignore:return_value_discarded
move_and_slide(velocity)
pass
Note: I edited your post to fix the formatting. Please use the “Code Sample” button when posting so your code will be readable.
What is wrong? You asked for a “fix” but didn’t state the problem.
kidscancode | 2019-08-25 15:07