Author Topic: How do I interpolate/extrapolate player position with Tnet?  (Read 2997 times)

gevarre

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Hi,
Love the package, but I'm having a few issues. I'm converting a project from straight Unity networking. The player is a vehicle, so it's input forces that are interpolated using M2H's "NetworkRigidBody.cs" script. This works just fine in the original project, but I'm looking for a similar solution with Tnet.

From reading the posts here, it seems that there's supposed to be no need for this with Tnet, but I'm seeing horrendous jittering, the same as I had with the original project Until I added the interpolation script. the way it would work is that the network view would watch the script, the script would interpolate/extrapolate where the player was supposed to be, then the network view would send the data using stream.isWriting, etc. I have no idea what would be analogous to this in Tnet. Anyone have any ideas?

It would be so immensly helpful if there was an fps example included in the package that people could build on, or even just something using the character controller. The included click-to-move sample is sort of helpful, but I don't think it's really all that applicable to the majority of users. Is anyone working on this?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How do I interpolate/extrapolate player position with Tnet?
« Reply #1 on: June 01, 2013, 01:32:53 AM »
I recommend separating your rigidbody from your renderer. Look at what I did with the cubes in the 2nd example. The renderer is always slightly lagging behind the rigidbody, giving more pleasant results, and the physics will always be where they should be.