martes, 4 de febrero de 2025

Gdscript, para Godot 4.3 sube un Area3d en eje "y" y a los 14 segundos lo borra; borra el Area3d;

 extends Area3D


var self_destruct_time = 14.0

var elapsed_time = 0.0


# Called when the node enters the scene tree for the first time.

func _ready() -> void:

        pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.

func _process(delta: float) -> void:

        elapsed_time += delta

        translate(Vector3(0, 0.019, 0)) # Corrected Vector3 values

        if elapsed_time >= self_destruct_time:

                queue_free()

No hay comentarios:

Publicar un comentario