extends Area3D
var Bullet = preload("res://PROYECTIL.tscn")
func _ready():
pass # Replace with function body.
func _input(event):
if event is InputEventMouseButton:
#if event.button_index == 1:
#if event.button_index == 1 and event.pressed == false:
var bullet = Bullet.instantiate()
add_child(bullet)
---------------------------------------------------------------------------
para disparos de 1 en 1, sin rafaga, sin que salgan 2 disparos al presionar 1 y soltar 1, solamente presionar 1---------------if event.button_index == 1 and event.pressed :
----------------------------------------------------------------------------
extends Area3D
var Bullet = preload("res://PROYECTIL.tscn")
func _ready():
pass # Replace with function body.
func _input(event):
if event is InputEventMouseButton:
if event.button_index == 1 and event.pressed :
#event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
var bullet = Bullet.instantiate()
add_child(bullet)
No hay comentarios:
Publicar un comentario