Mostrando entradas con la etiqueta boton 1 el 2 y la rueda el 3 al ser prersionada:;. Mostrar todas las entradas
Mostrando entradas con la etiqueta boton 1 el 2 y la rueda el 3 al ser prersionada:;. Mostrar todas las entradas

sábado, 27 de julio de 2024

Gdscript 3 ejemplos de una accion con el mouse, boton 1 el 2 y la rueda el 3 al ser prersionada;

 extends Area3D



var Bullet = preload("res://ARRANCA PERSONAJE ANDANDO Y MOVIENDOSE/proyectildefuego-1-tscn.tscn")




func _ready():




pass # Replace with function body.






func _input(event):






if event is InputEventMouseButton:




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


var bullet = Bullet.instantiate()


add_child(bullet)


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


var bullet = Bullet.instantiate()


add_child(bullet)

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


var bullet = Bullet.instantiate()


add_child(bullet)


func _unhandled_input(event):

if event is InputEventKey and event.pressed:

if event.keycode == KEY_W:

translate(Vector3(0, 0, 0) * get_process_delta_time())  # Temporary movement (consider physics)


#if event.keycode == KEY_


#apply_impulse(Vector3(0,40,4))#ORIGINAL



if event.keycode == KEY_Z:

rotate_x(0.02)

#pass

if event.keycode == KEY_X:

rotate_x(-0.02)

#pass



func _on_area_entered(area):

pass # Replace with function body.