- Home /
Question by
JBoy · Nov 04, 2012 at 09:53 AM ·
gameobjectplayerobjectnetwork
gameObject.find "Player" belonging to this network player???
How do I gameObject.find a game object named "Player" belonging to this network player? Or find an array of objects then narrow the result... Any help would be greatly appreciated.
Comment
use an RPC to do the job remotely ON THAT PLAYER. send back the results as needed :O
Answer by Shadamer · Dec 20, 2014 at 04:47 AM
Not sure I understand your question, but I'll give it a shot:
You might consider tagging your Player objects. Then you can do a FindGameObjectsWithTag("Player"). The second example in the docs might be what you're looking for: http://docs.unity3d.com/ScriptReference/GameObject.FindGameObjectsWithTag.html
Once you get your list of game objects, you can check to see who owns what. gameObject.networkView.owner.ToString()
Hope it helps.