Tasharen Entertainment Forum
Support => TNet 3 Support => Topic started by: Voxel on July 21, 2013, 02:21:16 PM
-
Hi,
I need to build a list of remote players avatars as a list of Transforms. Ideally I would like to use the TNManager.players array, as this is the first place to get updated when someone leaves the game.
I am wondering if there is an in-built method to quickly find the gameobject that is created when they join.
If not I will use more traditional methods to do it.
Thanks!
-
Inside a custom script derived from TNBehaviour attached to instantiated objects (player avatars), keep a list of all of them (static public, accessible) -- add to it in Awake, remove from it in OnDestroy. When you need to find a specific player, loop through that list matching its tno.ownerID.