Hi, I would like to have a variable to put at the end of the player inputs, so the same 'vehicle' can be used by multiple players (not in a networking game). I have the game working with two players, but wanting to add two more players makes my previous method of maintaining two separate player-vehicles double the pain. Therefore I'm looking to simplify and in my noobness I've come up with this - in the vehicle script:
var player_id = "1"
and in the process for controls in the vehicle script:
func integrate_forces(state):
if Input.is_action_pressed("ui_thrust_p%" %player_id) and is_dead == false: # ui_thrust_p1 is set up in the input map
applied_force = thrust.rotated(rotation)
I get the error - incomplete format in operator '%'.
What's wrong with the above?
Also I would like to know how to set the player_id when spawning the vehicle_scene in the game (from a player_spawner scene)?
Any input appreciated and specifics greatly so.
Thanks!