Когда ты хоть что то нажемаешь он наченает бесконечно ходить как это исправить
extends MeshInstance3D var dir = Vector3() const Speed = 10 # Called when the node enters the scene tree for the first time. func _ready(): pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta):
extends MeshInstance3D
var dir = Vector3()
const Speed = 10
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if Input.is _action_pressed("UP"):
dir.z = -1
if Input.is _action_pressed("DOWN"):
dir.z = 1
if Input.is _action_pressed("LEFT"):
dir.x = -1
if Input.is _action_pressed("RITE"):
dir.x = 1
if dir:
translate(Speed * dir * delta)