- Home /
Sync An Object not Controlled by Players
So I have a helicopter, and during the game it has a looping animation around the level. How do I sync its position across the whole network?
I understand that this is different than syncing a player's transformation because there is only one helicopter and it is not instantiated during runtime. It is already present during the level (this can change if need be).
Thanks in advanced!
Answer by tobiass · Feb 04, 2015 at 09:30 AM
If the heli always follows the same path, you only need to know when it started.
Assuming you use Photon due to the tag you used: The first player in a room starts the heli and saves a Custom Room Property "st" (e.g. for "StartTime") via room.SetCustomProperty(). The value is: PhotonNetwork.time, a synced timestamp for the room.
When a new player joins, that client looks up room.customProperties["st"]. You can calculate for how long the heli is flying. Then you only need to put the heli on the position of the path where it should be and let it fly.
Your answer
Follow this Question
Related Questions
PhotonView with ID has no method marked with the [PunRPC](C#) property! BUT IT HAS ??? 1 Answer
RPC with Random Numbers! 2 Answers
More efficient way to call these RPC's (Code works) 1 Answer
Best Solution for Multiplayer Shooting 1 Answer
Photon - RPC Does Trigger but Does not Show Over Network :( 0 Answers