Sync collider based on time stamp

arenoo

Member
Obviously, between one client sending the ShootableImpactModulesRPC and another one receiving it some amount of time passes and the collider on the receiving end may have moved to another location. Therefore when I shoot a running enemy and get a perfect hit, the rpc is sent and the enemy client checks if the collider on its end was hit and fails. I was thinking to fix this I would compare timestamps and get a delta time, multiply it by locomotion.velocity and subtract that from the collider position and this would give me a pretty good approximation. As you've already guessed it did not work. I get a delta time of about 0.1s (PhotonNetwork.Time -rpc.time) but the resulting delta position is off about a multiple of 5 (like delta time should have been 0.5s ?). What am I missing?
 
Back
Top