martes, 23 de enero de 2024

Script GDScript para Godot3d 4.2 cuando algo entra en Area3d borra diversos elementos y escala uno y cuando sale provoca sonido;

 extends Area3D



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

func _ready():

pass # Replace with function body.



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

func _process(delta):

pass



func _on_area_entered(area):

var parent = get_parent()

var Area3DBETA = parent.get_node("Area3DBETA")

#Area3DBETA.queue_free()

get_node("CollisionShape3DBETA").queue_free()

get_node("AMETRALLADOR DE BLENDER PINTADOBETA").queue_free()

get_node ("MeshInstance3DBETA")

scale.y+=5.0


scale.x+=5.2


scale.z+=5.2

pass # Replace with function body.



func _on_area_exited(area):

$AudioStreamPlayer.play()

pass # Replace with function body.


No hay comentarios:

Publicar un comentario