Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Whitby93 · Aug 04, 2016 at 05:36 AM · rigidbodynetworkingsmoothjitter

Networked Movement Jitter

 myTransform.position = Vector3.Lerp(myTransform.position, syncPos, Time.deltaTime * lerpRate);

lerpRate is set at 15, although fluctuating this number doesn't appear to make any difference. Removing the deltaTime thing also doesn't seem to make any difference. syncPos is the position the vehicle should be, a SyncVar being updated on FixedUpdate by the owner of the vehicle.

I have a similar system set up for rotation which I'm perfectly content with. At (very) slow speeds, I'm happy with the system outlined above. However, for medium/high speed, the vehicle jitters a lot, despite the lerp.

I'm not pretending to have a true understanding of what is going on, but I think it's to do with this:

Let's pretend it's not a Vector3. Let's pretend it's just a straight line. Let's also assume the vehicle is travelling at a constant speed.

FixedUpdate is running on the owner of the vehicle, but netlag and other things result in the information from the FixedUpdates not landing on the target client's computers at the same rate they left the owner's.

So, if the locations of this imaginary linear line were 3, 6, 9, 12, 15 and 18, representing a fixed rate of updating across a fixed space at a constant speed, but land in the target game instance in realtime, there's two options:

(This is based on the assumption of | 3, 3, 3 | 6, 6, 9 | 9, 9, 9 | 9, 12, 12 | 12, 15, 15 | 18, 18, 18 | being the syncPos in real time, and assuming there's exactly three updates for each fixedupdate.)

Run the lerp in FixedUpdate: The positions are read as 3, 6, 9, 9, 12, 18 - causing a stop between the two 9's and a jump between 12-18.

Run the lerp in Update: The entire lerp is at the mercy of netlag fluidly.

Both these options are awful. Of course, I may be entirely misunderstanding the situation.

So, I did plenty of reading before posting this about network prediction, particularly the type used in FPS games. The only conclusion I could draw, aside from that I didn't totally understand how to do any of it in UNET, was it was well above what is neccessary for this game and not exactly fit for purpose.

What I would like to do, is run each client 1/2 a second behind, giving time for the FixedUpdates to catch up and run the lerping between positions at the same constant rate they were sent, just, y'know, slightly late.

Smoothness between objects is much more important that half a second of lag, in this instance.

I don't thoroughly understand how to do what I want to achieve, but I suspect I could code this system through brute force using either SyncVar Hooks or replacing the SyncVars with ClientRPC's. Before I attempt this, could somebody with knowledge either shoot down the nonsense I've free-associated is going on, or reassure me what I want to attempt will fix the problem?

Of course, any better solutions/suggestions/workarounds would be incredible.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image bobmoff · Aug 18, 2016 at 07:29 AM 0
Share

I am in the same situation so I would love to hear peoples opinions on how to solve this using UNET.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How can I avoid jitter of house? 0 Answers

Airplane smooth acceleration problem 0 Answers

How to get transform.Translate to work with rigidbodies 2 Answers

Network rigidbody synchronize 0 Answers

Rigidbody jittering with camera follow 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges