Author Topic: Find remote player avatar  (Read 2072 times)

Voxel

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Find remote player avatar
« 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!
« Last Edit: July 21, 2013, 02:38:44 PM by Voxel »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Find remote player avatar
« Reply #1 on: July 22, 2013, 04:23:20 AM »
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.