Sound synchronization
parent
7714f274f6
commit
db788a1246
|
@ -56,7 +56,7 @@ func _ready():
|
||||||
func pick_random():
|
func pick_random():
|
||||||
return randi() % len(clips)
|
return randi() % len(clips)
|
||||||
|
|
||||||
func play():
|
sync func play():
|
||||||
|
|
||||||
if PlayUntilEnd:
|
if PlayUntilEnd:
|
||||||
if player.playing:
|
if player.playing:
|
||||||
|
|
|
@ -98,12 +98,12 @@ remote func walk(direction: Vector2):
|
||||||
velocity.z = lerp(velocity.z, - walkVelocity.rotated(- self.rotation.y).x, interpolation)
|
velocity.z = lerp(velocity.z, - walkVelocity.rotated(- self.rotation.y).x, interpolation)
|
||||||
|
|
||||||
if walkVelocity.length() > 0 and is_on_floor():
|
if walkVelocity.length() > 0 and is_on_floor():
|
||||||
$Sounds/Footsteps.play()
|
$Sounds/Footsteps.rpc("play")
|
||||||
#
|
#
|
||||||
remote func jump():
|
remote func jump():
|
||||||
if is_on_floor():
|
if is_on_floor():
|
||||||
velocity.y = JUMP_VELOCITY
|
velocity.y = JUMP_VELOCITY
|
||||||
$Sounds/Jump.play()
|
$Sounds/Jump.rpc("play")
|
||||||
|
|
||||||
remote func mouselook_abs(x, y):
|
remote func mouselook_abs(x, y):
|
||||||
camera.rotation.x = x
|
camera.rotation.x = x
|
||||||
|
|
Reference in New Issue