Player rotation not synching on SetPositionAndRotation

kompanions

New member
Hi, I am changing the position and rotation for teleporting my player using "SetPositionAndRotation". Player's position is changing on network but the rotation is not working properly. The rotation is changing to the passed value of rotation but instantly it changes to the last rotation of player on network i.e. the rotation value before teleportation. The position and rotation of player is working fine in local instance, but need to make it work on network. Please suggest the way to make it work.
Thanks in advance.
 
I believe that this is something similar to what @FastSkillTeam ran into. The problem relates to the latency in the network. In the next update I will be adding a parameter that specifies if you want to send the set event over the network.
 
Yes, it is most certainly a latency issue and is impossible to avoid without some trickery. Although it only occurs when doing something tricky, as for its standard function in standard use case scenarios it works well.

Yes, the update will make it much easier to rectify in these tricky cases. For now you can set the player transform position and rotation manually and locally (not using UCL.SetPositionAndRotation), then when an rpc is received use your values that the local character is at or should be at when the rpc is received. If teleporting use the target object transform values, and again set the position and rotation manually via the transform. Also you may need to disable the PUN Character Transform Monitor just before doing this and then enable it right after, for both local and remote.

Hope this can help for now, I think there was some other things I did for setting position and rotation(delta rotation it think was one), but if you follow your nose through UCL.SetPositionAndRotation() you basically want to do what it does, but do not transmit, use your own rpc so that the position and rotation isn't set again after its been done.
 
Were you overriding snap animator when using SetPositionAndRotation() before? because that could of been the cause in your case. It is best not to modify UCC code, you will need to redo your changes each update.
 
Yes i have tried the both way overriding the snapAnimator and without overriding it. Unfortunately both didn't work for me. If you can provide any other solution then i can revert the UCC code and fix as per your suggestions.
 
My asset Ultimate Seating Controller has a perfect extreme use case included, players can teleport to an object moving at any speed with zero complications. I did a mixture of methods to achieve what was required for this, my intention was to create an update friendly add-on. The update to UCC will include an override to do all of this in 3 lines of code. SetPosAndRot(notSending) > Send RPC for what is required > SetPosAndRot(notSending) on client when RPC is received.
 
Top