adds joystick and textures

This commit is contained in:
Luca 2024-09-15 20:41:40 +02:00
parent 554d81b912
commit 8c29b8bffd
779 changed files with 16481 additions and 7 deletions

View file

@ -34,6 +34,11 @@ func _physics_process(delta: float) -> void:
animated_mesh.fall()
var direction := (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
# Move character to the direction
if direction.length() != 0:
$GobotSkin.rotation.y = atan2(direction.x,direction.z)
if direction:
velocity.x = direction.x * SPEED
velocity.z = direction.z * SPEED
@ -42,3 +47,6 @@ func _physics_process(delta: float) -> void:
velocity.z = move_toward(velocity.z, 0, SPEED)
move_and_slide()
if velocity.length() < 0.01:
animated_mesh.idle()