Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 moghes · Feb 04, 2014 at 01:42 PM · networkingpositionphotonstate-synronization

Update position via state syncronization results in weird movement.

Hello,

This is my first multiplayer project and this might be a basic question.

I am using PUN (Photon Unity Networking) but it has a very similar worflow as the unity networking.

I have characters with animation, character controller and third person script attached. Everything runs but the state syncronization.

I have photon View attached on parent and each child and draged the transform component to the observe field, also chosen Unreliable as Observe option.

I open 2 instances of the game (run 2 games, join and start moving the character), I see strange movement (like shaking, going back and fort so fast) in the second window.

I need some directions of what to correct or search at least. Thanks

Comment
Add comment · Show 2
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 Mortoc · Feb 04, 2014 at 05:05 PM 0
Share

Not exactly an answer, but every project I've done that uses networking I've had to avoid the view/observer pattern because networking is just more complicated than that simplistic channel leads you to believe.

I'd try using the [RPC] interface in PUN and implementing your own smoothing/dead reckoning.

avatar image moghes · Feb 05, 2014 at 08:53 AM 0
Share

@$$anonymous$$ortoc according to my knowledge, The RPC calls are used for a different purpose than State syncronization. I need to Update the position at every frame. So far the observe channel is the only method available.

I am using the callback function:

 void OnPhotonSerializeView(PhotonStream stream, Photon$$anonymous$$essageInfo info)
     {
         if (stream.isWriting)
         {           
             stream.SendNext(transform.position);
             stream.SendNext(transform.rotation);
         }
         else
         {            
             this.correctPlayerPos = (Vector3)stream.ReceiveNext();
             this.correctPlayerRot = (Quaternion)stream.ReceiveNext();
         }
     }

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

19 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

Related Questions

Photon Network syncing the transform of a moving platform 0 Answers

how can i set multiplayer online in my ludo game as i have many objects for a player like dice and 4 players for each player but i can only add one player . What i make my player 0 Answers

Network Interpolated Transform resets position? 1 Answer

Photon Cloud Networking: OnPhotonSerializeView Not Firing 9 Answers

Photon Unity Networking (Viking Demo) Error: Argument is out of range. 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