Im scripting the the input to have different set of inputs for Retropie and keyboard with mouse
https://retroflag.com/Classic-USB-Controller-M.html
func _physics_process(delta):
direction = Vector3()
if Input.is_action_just_pressed("fire"):
if aimcast.is_colliding():
var b = bullet.instance()
muzzle.add_child(b)
b.look_at(aimcast.get_collision_point(), Vector3.UP)
b.shoot = true
if not is_on_floor():
fall.y -= gravity * delta
if Input.is_action_just_pressed("jump") and is_on_floor():
fall.y = jump
if Input.is_key_pressed(KEY_W) || if Input.is_joy_button_pressed(12):
direction -= transform.basis.z
elif Input.is_key_pressed(KEY_S)|| if Input.is_joy_button_pressed(13):
direction += transform.basis.z
if Input.is_key_pressed(KEY_D):
direction += transform.basis.x
if Input.is_key_pressed(KEY_A):
direction -= transform.basis.x
if if Input.is_joy_button_pressed(14):
direction -= rotation.x
elif if Input.is_joy_button_pressed(15):
direction += rotation.x
direction = direction.normalized()
velocity = velocity.linear_interpolate(direction * speed, acceleration * delta)
velocity = move_and_slide(velocity, Vector3.UP)
move_and_slide(fall, Vector3.UP)
this input
if Input.is_key_pressed(KEY_W) || if Input.is_joy_button_pressed(12):
direction -= transform.basis.z
has this error
Error parsing expression, misplaced: if