12 lines
291 B
GDScript
12 lines
291 B
GDScript
extends AudioStreamPlayer2D
|
|
|
|
@onready var player = $"../../"
|
|
|
|
func _physics_process(delta):
|
|
pitch_scale = lerp(pitch_scale, abs(player.velocity.y) / 200, delta * 5)
|
|
|
|
if player.isWallSliding() and playing == false:
|
|
playing = true
|
|
elif player.isWallSliding() == false:
|
|
playing = false
|