viernes, 8 de diciembre de 2023

Borrar por script en godot3d version4.2;




Estos ejercicios de scrpt me han dado resultado y e conseguido que un cubo partiendo de base de un nodo Area3d al colisionar con otro se borre del juego al ejecutarse.......



------------------------------------------------------------------------------------------


extends Area3D



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

func _ready():

pass # Replace with function body.




func _on_area_entered(area):

queue_free()

pass # Replace with function body.








---------------------------------------------------------------------------------------------------












extends Area3D


# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.



func _on_area_entered(area):
queue_free()
pass # Replace with function body.
func _process(delta):

scale.y*=1.55

pass






-----------------------------------------------------------------------------------------------


extends Area3D


# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.



func _on_area_entered(area):
queue_free()
pass # Replace with function body.
func _process(delta):

#scale.y*=1.55
translate(Vector3(0,0.02,0))
pass




---------------------------------------------------------------------------------------------------------------



extends Area3D


# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.



func _on_area_entered(area):
queue_free()
pass # Replace with function body.
func _process(delta):

#scale.y*=1.55
translate(Vector3(0,0.001,0))
pass










Escala un cubo para Godot4.2;

 extends RigidBody3D



# 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):

scale.y*=1.55

pass


Da un tipo de impulso hacia arriba en un cubo script para Godot3d 4.2;

 extends RigidBody3D



# 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):

#translate(Vector3(0,0.08,0))

#pass



func _process(delta):

apply_torque_impulse(Vector3(0,0.08,0))

pass


Sube un cubo lentamente en Gdscript para godot 4.2;

extends RigidBody3D



# 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):

translate(Vector3(0,0.08,0))

pass


Rota cubo en eje "y" a velocidad 44 en godot 4.2 con Gdscript;

 extends RigidBody3D



# 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):

rotate_y(44)

pass


Demo de videojuego echo en Godot3d version de Godot 4.2;

 Demo de juego echo en Godot version 4.2

Esta echo para windows  se tiene que descargar ....intentaba hacerlo para html5 pero no tengo conocimientos para hacerlo, en fin en windows funciona de maravilla...