Sound synchronization

remotes/1705382094874458415/tmp_refs/heads/godot4-port
Jan 2020-09-28 00:06:43 +02:00
parent 7714f274f6
commit db788a1246
2 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,7 @@ func _ready():
func pick_random():
return randi() % len(clips)
func play():
sync func play():
if PlayUntilEnd:
if player.playing:

View File

@ -98,12 +98,12 @@ remote func walk(direction: Vector2):
velocity.z = lerp(velocity.z, - walkVelocity.rotated(- self.rotation.y).x, interpolation)
if walkVelocity.length() > 0 and is_on_floor():
$Sounds/Footsteps.play()
$Sounds/Footsteps.rpc("play")
#
remote func jump():
if is_on_floor():
velocity.y = JUMP_VELOCITY
$Sounds/Jump.play()
$Sounds/Jump.rpc("play")
remote func mouselook_abs(x, y):
camera.rotation.x = x