- Home /
How to identify which player picked up a weapon and change parameters based on that?
I have a local Multiplayer Game with weapon pickups. When Player 1 picks up the weapon, I want it to shoot Projectile_A, when Player 2 picks up the same weapon, I want it to shoot Projectile_B instead.
Any thoughts on how to set this up? I have the weapon pickup working, but only with Player 1 atm.
Assu$$anonymous$$g they are both instances of the same object, you can assign them tags. You can then check on pickup, which tag is currently present. This can be done by something like
gameObject.tag.Equals("Player1");
$$anonymous$$ind the case sensitivity.
This definitely seems like it will work, or at least put me on the right track towards what I'm going for. Thanks!
Can you reply as a full response so that I can award your answer?
Answer by Klarzahs · Jan 09, 2019 at 09:47 AM
Sure, here it is again as an answer.
Assuming they are both instances of the same object, you can assign them tags. You can then check on pickup, which tag is currently present. This can be done by something like
gameObject.tag.Equals("Player1");
Your answer
Follow this Question
Related Questions
How to create and set different Player ID's to individual controllers? 0 Answers
Asymmmetric VR setup 0 Answers
SmartFox Objects?? 0 Answers
How i can setup Character 0 Answers
Offline testing a player object? 0 Answers