Syncing Query...
Options
Manhiem
✭
Hey Developers,
I am facing a query on syncing the rotation of the player. The movement is succesfully being synced.
I have a state called MyState and i and trying to achieve it as:
state.SetTransforms(MyState.PlayerTransform.Rotation, transform.rotation);
OR
state.SetTransforms(MyState.PlayerTransform.Rotation, GetComponent<RigidBody>().rotation);
Both of them are throwing errors as UnityEngine cannot convert from UnityEngine.transform to UnityEngine.Quaternion and UnityENgine cannot convert BoltNetwork.transform to UNityENgine,Quaternion.
Can the developers help me in this case by providing the syntax or the code that i have to use...
Thanks in Advance ))
I am facing a query on syncing the rotation of the player. The movement is succesfully being synced.
I have a state called MyState and i and trying to achieve it as:
state.SetTransforms(MyState.PlayerTransform.Rotation, transform.rotation);
OR
state.SetTransforms(MyState.PlayerTransform.Rotation, GetComponent<RigidBody>().rotation);
Both of them are throwing errors as UnityEngine cannot convert from UnityEngine.transform to UnityEngine.Quaternion and UnityENgine cannot convert BoltNetwork.transform to UNityENgine,Quaternion.
Can the developers help me in this case by providing the syntax or the code that i have to use...
Thanks in Advance ))
0
Comments
-
You need to use the NetworkTransform from the state and the transform you want to sync when making the call. Within the state property itself you can specify that you only want rotation synced and other options.
https://doc.photonengine.com/en-us/bolt/current/demos-and-tutorials/bolt-basics/bolt-103-properties-and-callbacks0 -
@stanchion
Can you please give me the syntax as i cannot find the correct code that i have to use.
Thanks in Advance!0