This repository has been archived on 2025-09-12. You can view files and clone it, but cannot push or open issues or pull requests.
ld47/objects/Fire.gd

23 lines
498 B
GDScript

extends Spatial
var emitting: bool = false
var character: Node
func _ready():
pass
func _process(delta):
$Particles.emitting = emitting
$Light.visible = emitting
if emitting and character and !character.dead:
$AudioStreamPlayer3D.play()
character.die("fire")
character = null
func _on_Area_body_entered(body):
if body is PlayerCharacter and !body.dead:
character = body
func _on_Area_body_exited(body: Node) -> void:
if body is PlayerCharacter and !body.dead:
character = null