Adds missing data
This commit is contained in:
parent
e6391d9fdd
commit
53cdcc3433
620 changed files with 47293 additions and 151 deletions
25
prefabs/movement_player.gd
Normal file
25
prefabs/movement_player.gd
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
extends AudioStreamPlayer3D
|
||||
|
||||
@export var threshold: float = 1.5
|
||||
@export var targetElement: Node3D
|
||||
|
||||
var currentLocation: Vector3
|
||||
var distance: float
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
currentLocation = targetElement.global_position
|
||||
distance = threshold
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
|
||||
var positionDistance = targetElement.global_position.distance_to(currentLocation)
|
||||
currentLocation = targetElement.global_position
|
||||
|
||||
distance = distance - positionDistance
|
||||
if (distance > 0):
|
||||
return
|
||||
|
||||
distance = threshold
|
||||
play()
|
||||
Loading…
Add table
Add a link
Reference in a new issue