Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Fusegene Studios |
extends KinematicBody2D
var speed = 200
var velocity = Vector2()
func _ready():
pass
func _physics_process(delta):
velocity = Vector2()
if Input.is_action_pressed(“up”):
velocity -= speed
if Input.is_action_pressed(“down”):
velocity.y += speed
if Input.is_action_pressed(“left”):
velocity.x += speed
if Input.is_action_pressed(“right”):
velocity.x -= speed
move_and_slide(velocity)
look_at(get_local_mouse_position())
Please don’t post the same question multiple times. If you have additional information, just add it to the original post by 1) editing the post or 2) adding additional Comments
.
I’d recommend that you Hide
this copy of the question and continue in the original one. That way, any/all input from the community will be in the same place.
jgodfrey | 2023-02-03 23:08
is this the exact copy of your code? or did you rewrite it? because there’s some minor typos in your code
Edit: just saw that underscores are removed if not put in code blocks…
phteven | 2023-02-04 03:53