Author Topic: How to access an object created with TNManager.Create?  (Read 1954 times)

Danim3D

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
    • http://www.Danim3D.com
How to access an object created with TNManager.Create?
« 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";

Ferazel

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 150
    • View Profile
Re: How to access an object created with TNManager.Create?
« Reply #1 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