Author Topic: instance of object after TNManager.Create  (Read 3470 times)

creativitysquare

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 2
  • Posts: 41
    • View Profile
instance of object after TNManager.Create
« on: October 11, 2014, 11:58:30 AM »
Hi everybody, new to Tnet and need some help to start up as i am a bit lost ...

1. When you instantiate a gameobject via TNManager.Create, how do i get the object that has been just created? How do I reference exactly that object? With unity networking the method instantiate returns an Object. TNManager.Create doesnt. At the moment once is created I go find it in the world with his name but is a terrible way...
2. I didnt get the concept of Player and PLayerID. How do i associate my app to a object instantiated with Create to avoid other players from moving it?
3. When i create a server, does it have to be a full app containing all the scenes and objects for the clients to be able to interact ?

Thanks a lot
eg

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: instance of object after TNManager.Create
« Reply #1 on: October 11, 2014, 07:01:01 PM »
1. You don't. Created objects get created on the server, and you don't get a response until later. If you need to pass parameters to your created object, use RCCs (sticky post on this forum explains how).

2. Check tno.isMine (if the script is derived from TNBehaviour), or GetComponent<TNObject>().isMine otherwise.

3. Server is just a ~50 kb executable that comes with TNet. It doesn't even need Unity, so no.

creativitysquare

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 2
  • Posts: 41
    • View Profile
Re: instance of object after TNManager.Create
« Reply #2 on: October 11, 2014, 07:57:25 PM »
thanks for getting :)
Will figure out the RCC!
this stuff you do is amazing man...