Author Topic: TNObject ID not assigning a unique ID number to itself  (Read 3063 times)

Voxel

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
TNObject ID not assigning a unique ID number to itself
« on: July 14, 2013, 04:02:32 PM »
Hi,

This is probably something I am not understanding, but I though TNObject automatically assigns a unique ID number to itself.

For example I have a TNObject in a child of a parent that is being spawned using TNet. I have a script which has an @RFC in the child object that the TNObject is attached to.

Is this right?

Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNObject ID not assigning a unique ID number to itself
« Reply #1 on: July 14, 2013, 07:08:51 PM »
TNObject only receives a unique ID if it's instantiated using TNManager.Create(prefab). If you use GameObject.Instantiate or just attach a script, it won't have a unique ID.

Voxel

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: TNObject ID not assigning a unique ID number to itself
« Reply #2 on: July 15, 2013, 05:16:07 AM »
The TNObject is in a child of the gameobject that is instantiated by TNManager.Create(prefab) - Is it only TNObjects in the root of the instantiated object that are assigned ID numbers? Or should all TNObjects that are part of the TNManager.Create instantiated gameobject be assigned unique ID numbers?


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNObject ID not assigning a unique ID number to itself
« Reply #3 on: July 15, 2013, 06:50:11 AM »
Child TNObjects currently don't get their own ID, and instead use the parent's ID.

Voxel

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: TNObject ID not assigning a unique ID number to itself
« Reply #4 on: July 15, 2013, 07:03:22 AM »
Ahhh, OK, so if I leave the ID number of the child TNObject as 0, it will show as zero but will be still accessible as normal?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNObject ID not assigning a unique ID number to itself
« Reply #5 on: July 15, 2013, 07:07:05 PM »
Yup.