Mail.ruПочтаМой МирОдноклассникиВКонтактеИгрыЗнакомстваНовостиКалендарьОблакоЗаметкиВсе проекты

Персонаж не ходит GODOT 4 3d

3anyda 123 Ученик (90), открыт 2 недели назад
Когда ты хоть что то нажемаешь он наченает бесконечно ходить как это исправить


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)
0 ответов
Похожие вопросы