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())
Edited to fix code formatting. In future posts, please use the {}
button to format code in your posts. Otherwise, it’s difficult to read.
jgodfrey | 2023-02-03 22:07
Are you really using Godot 3.2.1? If so, I wonder why you’re using such an old version?
jgodfrey | 2023-02-03 22:10
that version was realeased in 2022 google says how is it old
Fusegene Studios | 2023-02-03 22:17
Not sure what info you’re looking at. According to this article, it was released in March of 2020.
jgodfrey | 2023-02-03 22:25
The current release is 3.5.1. Download from here (if you want).
jgodfrey | 2023-02-03 22:26
i did not mean to say 2022 I meant to say 2020 mis said it sorry
Fusegene Studios | 2023-02-04 02:19