Tasharen Entertainment Forum

Support => TNet 3 Support => Topic started by: Danim3D on August 01, 2014, 02:50:54 PM

Title: How to access an object created with TNManager.Create?
Post by: Danim3D on August 01, 2014, 02:50:54 PM
When I use TNManager.Create
How do I access the object that I just created to change the name for example?
  1. TNManager.Create(Ball, pos, transform.rotation);

For example, when I use Instantiate I rename like this:
  1. GameObject myBall = (GameObject)Instantiate(Ball, pos, transform.rotation);
  2. myBall.name = "ChangedBallName";

I did try this but it give me an error:
  1. GameObject myBall = (GameObject)TNManager.Create(Ball, pos, transform.rotation);
  2. myBall.name = "ChangedBallName";
Title: Re: How to access an object created with TNManager.Create?
Post by: Ferazel on August 01, 2014, 06:12:48 PM
You can't access it right away, you need to wait for a network packet to go through which is asynchronous. If you need to set the name when the object is created, look at the sticky for RCCs as that worked for us. (except that in the RCC the TNObject uid hasn't been assigned yet)

http://www.tasharen.com/forum/index.php?topic=5416.0