What input is causing this error?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Dudedude123

Im scripting the the input to have different set of inputs for Retropie and keyboard with mouse

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

:bust_in_silhouette: Reply From: jgodfrey

You don’t want that second if here…

if Input.is_key_pressed(KEY_W) || if Input.is_joy_button_pressed(12):

Instead, that should be:

if Input.is_key_pressed(KEY_W) || Input.is_joy_button_pressed(12):