Author Topic: TNet syncing issue  (Read 4336 times)

thelebaron

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 15
    • View Profile
TNet syncing issue
« on: January 06, 2014, 11:28:23 AM »
So I am just starting out with tnet, switching from photon. Im also rather new to coding so anyways.
Im having a issue where objects that already exist within a scene dont really seem to sync in terms of position(using TNAutosync observing position and rotation), whereas objects that are instantiated using TNautocreate do get synced.
They are the same prefabs, so Im wondering what Im doing wrong?

thelebaron

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: TNet syncing issue
« Reply #1 on: January 06, 2014, 01:54:05 PM »
Ok false alarm, i fixed it by using the TNsyncrigidbody instead of TNautosync. Shouldnt they do the same thing? why would autosync only work after something has been instantiated(but it actually seems to be syncing some health values I setup, just not the position/rotation values of the transform on the non instantiated prefabs)?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet syncing issue
« Reply #2 on: January 06, 2014, 09:49:28 PM »
Objects that already exist in the scene should have a valid unique TNObject ID specified. TNAutoCreate simply instantiates an object using TNManager.Create, which assigns a valid ID for you, but the same doesn't occur for existing objects.

thelebaron

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: TNet syncing issue
« Reply #3 on: January 09, 2014, 01:32:23 AM »
Actually I think Im still having a few issues, basically I have some rigidbodys in a scene. There is no movement except by collisions with players, and their rotation is constrained except on the Y axis so they kind of glide around.

When I push them around using a nonhost player, they sometimes sort of desync. If the host bumps into the desynced rigidbody on a nonhost screen, they can still push them around. If a host bumps into a desynced(for everyone else but not the host) rigidbody on the host's screen they reset/snap into place for the nonhost players.
I am using the example spring transform and decoupled renderer from rigidbody setup.

Is this an inertia thing? When using the Syncrigidbody with simple boxes it works, but the 'gliding' seems to only work for a bit and then it just fails to sync up.



 I also had a quick question about setting up moving objects:

"- GameObject with LagPosition (and possibly LagRotation) on it
-- Renderer"

what is the lag position and lagrotation? Is that the lerped position/rotation or something else?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet syncing issue
« Reply #4 on: January 10, 2014, 06:14:13 PM »
SyncRigidbody works only on the host, or the object's owner, I don't remember off the top of my head as I'm not home right now. No one else can call its Sync() function. If you want synchronization to come from other players, you will need to use your own RFCs.