jueves, 11 de enero de 2024

Script para godot3d 4.2 cuando presiono tecla "M" se reinicia el juego; esta puesto en un MeshInstance3D; y es bicnieto;

 extends MeshInstance3D



# 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 _unhandled_input(event):

if event is InputEventKey:

if event.pressed and event.keycode == KEY_M:

get_tree().reload_current_scene()

#rotate_y(90.88)



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

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

Explicacion;

Script para godot3d 4.2 cuando presiono tecla "M"  se reinicia el juego; esta puesto en un MeshInstance3D; y es bicnieto; me vengo a referir , intento aclarar el nodo raiz padre del juego es un

World de el sale un Area3d de esta sale un CollisionShape3D de este asi mismo sale el MeshInstance3D contenedor del script que funciona perfectamente, ejecuto el juego y cuando presiono tecla "m" se empieza el juego de nuevo.