Home / Forums / Photon Stream Serialization with IPunObservable (OnPhotonSerializeView)

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Tutorial

Photon Stream Serialization with IPunObservable (OnPhotonSerializeView)

NoRecoilDev
Input & Recoil Math
MEMBER
Rep: 130
Join Date: Nov 2024
Posts: 20
Thanks: 32
2y ago · Jul 1, 2024 12:18 PM
#1
Writing and reading continuous position, rotation, and animation state streams in Unity Photon games.
NoRecoilDev | Smoothing Algorithms & Input Events
The following users thanked NoRecoilDev for this post:
CitizenNative
RAGE Engine & FiveM Dev
VIP
Rep: 315
Join Date: Sep 2022
Posts: 21
Thanks: 82
2y ago · Jul 1, 2024 2:50 PM
#2
Implement IPunObservable. In OnPhotonSerializeView, use stream.SendNext(pos) when stream.IsWriting and stream.ReceiveNext() when stream.IsReading.
CitizenNative | RAGE Engine & FiveM Native Calls
ImGuiStyler
ImGui Animation Specialist
MEMBER
Rep: 210
Join Date: Mar 2024
Posts: 22
Thanks: 55
2y ago · Jul 1, 2024 8:50 PM
#3
Applying lag compensation interpolation (Vector3.Lerp) between received network snapshots prevents choppy entity movement.
ImGuiStyler | Clean Custom UI Controls & Easing