Files
Aula-Godot-3D/test/Scripts/armadilha.gd
T
2026-05-28 08:51:08 -03:00

16 lines
388 B
GDScript

extends MeshInstance3D
@export var damage_trap := 1
var Execute:= false
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
func _on_area_3d_body_entered(body: Node3D) -> void:
while Execute ==false:
body.damage(damage_trap)
Execute = true
await get_tree().create_timer(1.0).timeout
Execute = false