domingo, 25 de agosto de 2024

Para instanciar un proyectil con Godot 4.3 script GDScript, al presionar boton izquierdo del raton;

 extends Area3D


var Bullet = preload("res://PERSONAJES/CAVEZA NIÑO MONSTRUO ATACANDO/caveza_ataca.tscn")

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

pass




func _input(event):


if event is InputEventMouseButton:




if event.button_index == 1 and event.pressed :


var bullet = Bullet.instantiate()



add_child(bullet)

No hay comentarios:

Publicar un comentario