adds joystick and textures
This commit is contained in:
parent
554d81b912
commit
8c29b8bffd
779 changed files with 16481 additions and 7 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue