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
0
Question by VincentR · May 01, 2018 at 12:34 PM · rigidbodynetworkingnetworksynchronization

Unet Rigidbody Sync on Client

Hello all, thanks for reading this.

I'm trying to make a multiplayer game with Unet ( again, not my first try ).

Basically what i'm trying to do, is making a player push a ball, using only rigidbodys for now (rigidbody2D) alt text

On the host, it's working fine, but on the client, the ball is going back and forth against the player, as if the ball were stuck to the player. I don't think it's a classic sync issue per se, because, on the client, the host player is well synchronized, and the ball too as long as i dont touch it on the client.

I've tried multiple plugins ( Forge, NST ... ) that didn't help me with this ( actually it was worse in certain cases ). I also tried to disable the rigidbody on the client, and only sync the transform of the ball, but it didn't work. Finally, I tried to disable the LocalPlayerAuthority ( this seems to be the issue ), and send commands from the client to move the player on the server. This has been the "best" solution so far, but my player is stuttering in its movement, and often touch the ball on the client although there's a space between it and the ball ( i'm guessing latency ).

I really don't know what more to do, except coding my own network environnement, and I'm not even sure that will fix these issue.

Do you have any idea? Is UNET really usable? I've seen a lot a post from 2016, but not so many in the recent months.

Thanks

sshimpsoccer.png (159.1 kB)
Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by MGijs · May 04, 2018 at 08:20 AM

I ran into a similar problem when creating a fast-paced multiplayer game that was using rigidbodies, here are some tips that helped me to improve my game:

  1. Only run physics on the server, I separated the game object that had force applied on it into a physics object and a visual object

  2. The server physics object sets the position of the visual object and using a syncvar I synced the position of the visual object on all clients

  3. When moving the players rigidbody I send the requested position as command to the server, then i call a rpc method to set the position; rigidBody2d.MovePosition(position)


There is also a plugin which allows you to easily sync rigidbodies and transforms using interpolation and extrapolation although this might be difficult to tweak using fast-paced gameplay but you can have a look at it nonetheless: https://assetstore.unity.com/packages/tools/network/smooth-sync-96925

Hope this will help you to improve your game

Comment
Add comment · Share
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
0

Answer by VincentR · May 04, 2018 at 01:23 PM

Hello, Thanks for your answer.

Indeed that's basically what i've been doing so far, and what works the "best" ( i dont think it's perfect )

I have questions though, if you can answer them :

2 => Why use SyncVar instead of a NetworkTransform ? Is it faster? Network Transform has an interpolation system that makes things smoother on the client.

I looked at SmoothSync but I dont really want to spend money in something i'm not sure will be working in my project. do you have it? did it help you in yout project?

Comment
Add comment · Share
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

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

165 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to sync variables with UNET 3 Answers

Load Previously Instantiated Network Objects 1 Answer

Synchronizing Gameobjects over a Network Server < - > Client Sync 0 Answers

Network or camera desync or something else? 0 Answers

[Networking] Sync child rigidbodies 0 Answers


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