Photon Transform View Not Syncing

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Photon Transform View Not Syncing

Mashimaro7
2021-06-29 15:37:08

I'm not sure what's going on, I have a photon transform view on both my model and the "holder" of the model. It was working just fine, until I swapped out models? Idk I've been working on this for 10s of hours so I might've changed something in code, but it WAS working fine before.

I have an animation that sits down in a chair. So, the weird thing is the position is off, but only on the player who sits' screen, and not the other player's screen. Here's a screenshot,

https://imgur.com/a/yYfJT7V

It was working on both before. I don't understand it, but either way this would indicate that the Transform View is not syncing as it should, as the position is displaying differently on both screens. The model is at 0,0,0. And this is the exact same animation I was using before, so it's not some issue with the animation(I also have animator views on the armatures, set to continuous on all parameters)

Here's a Pastebin, the sit down method is at 209.

https://pastebin.com/DnHBEnhb

Apologies for my super messy code. Since it's not super obvious, p is the player holder, player is the model, and this script is attached to the camera, so any "transform.position"s are moving the camera. Also probably not super important, but this is a VR game for mobile, and I have tested it with editor and mobile, one or the other sitting, the result is always the same, the one doing the sitting clips through the chair, but the one not sitting sees them sitting perfectly fine.

Thanks.

Comments

Mashimaro7
2021-06-30 19:33:32

I solved it, I think it was because my animation was actually setting the position and for some reason that was not syncing over? Still weird, as I had a transform view on both the model, and the holder, as well as an animation view, Maybe it's something the Photon devs should look into?

Tobias
2021-07-01 08:57:11

I am not a master of Animations myself but I think there is a way for Animations to set absolute positions. That collides with moving the character around, of course.
Glad you found a solution. Will check if a colleague can chime in.

jeanfabre
2021-07-01 09:48:57

Hi,

could it be that you prevent the PhotonTransformView to work when it's sit down? it could be then a matter of timing, maybe you sit, but the position is still not reaching every instance, and so you lock in place, but it's not the final place.

Bye,

Jean

Mashimaro7
2021-07-01 12:58:54

@Tobias wrote: »

I am not a master of Animations myself but I think there is a way for Animations to set absolute positions. That collides with moving the character around, of course.
Glad you found a solution. Will check if a colleague can chime in.

I'll have a look, there still seems to be some strange issues when sitting down... All other times the position is synced perfectly.

@jeanfabre wrote: »

Hi,

could it be that you prevent the PhotonTransformView to work when it's sit down? it could be then a matter of timing, maybe you sit, but the position is still not reaching every instance, and so you lock in place, but it's not the final place.

Bye,

Jean

Nope, I stop movement when sitting but i never alter the transform views in any way. They're set to sync position at all times.

jeanfabre
2021-07-01 13:06:04

Hi,

can you debug the value of the wrong sitting position against the value received by the photonTransformView cause at this point we need to make sure you are getting the right information from the PhotonTransformView.

Bye,

Jean

Back to top