Hey I have a small single Player game.
The Player can pickup Boosters for which I have the following script attached to the Booster:
override protected void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "Player")
{
//Set fire range of lasers to max
playerControls.pickup = true;
}
}
So when the Player hits the powerup, the powerup sets the pickup bool in the playerControls to true.
This works as intedned right now. Now I wanted to add a multiplayer to my game. Each Player character has the playerControls script attached. If One Player picks up the powerup “pickup” on all Player scripts is being set to true.
How can I make it that only the pickup of the Player who collided with the powerup gets it ?
I already tried something like:
other.playerControls.pickup = true; but this does not work. Any clues ?