Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all articles
Browse latest Browse all 8947

Destroying grenade over the network

$
0
0
Hey,

I implemented a grenade and I got a tiny issue. The grenade sends a RPC once it is hot and the time is ticking. Once the timer reaches 0 it will explode. The owner of the object calls PhotonNetwork.Destroy to get rid of the grenade.

Sometimes it happens that the grenade does not explode for people. I guess that is because they receive PhotonNetwork.Destroy too early and the grenade is removed for them before it can explode.

My idea was to call RemoveRPCs (to avoid new instantiation for other players) instead and to just Destroy it locally. But I'm worried that this would not free up allocated viewIDs and so on that could make me run out of them after a while. Do I need to unallocate view ids or what else should I do to make the grenade working in a reliable way?

Thank you!

Viewing all articles
Browse latest Browse all 8947

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>