Im making the FPS rotation control for the gamepad
rotation.x = Input.is_action_just_pressed("turn_left") - Input.is_action_just_pressed("turn_right") rotation.y = Input.is_action_just_pressed("look_up") - Input.is_action_just_pressed("look_down")
I keep getting this error Parse Error: Invalid operand types (“bool” and “bool”) to operator “-”.
You’re getting the error because is_action_just_pressed() returns a bool (so, true or false). And, since it’s not possible to subtract one bool from another, you get the error you mentioned. Maybe you’re looking for something like:
is_action_just_pressed()
bool
true
false
rotation.x = Input.get_action_strength("turn_left") - Input.get_action_strength("turn_right")
… or …
rotation.x = get_axis("turn_left", "turn_right")