Is there a way to tell if the remote instance of a Network.Instantiate object still exists (or not)? I want to delete a remote instance locally, and then later call Network.Destroy without an error.
I am making a (2D) game where players can shoot bullets at each other. I’m using Network.Instantiate for the bullets so that I can destroy all its remote copies when the creator decides.
For the remote instances, I want the bullets to look like they’re behaving normally, but only the creator can destroy the bullet and choose to inflict damage on players. (I understand this is not a secure method, but it’s just for a prototype and I hear Unity’s networking isn’t secure anyway.)
SO! If a remote bullet thinks it hit a player, but the creator doesn’t think it’s hit yet, I want to destroy the remote instance locally. Later, on the frame the creator thinks the bullet “really” hit, I want to Network.Destroy the bullet. But this throws an error: Couldn't perform remote Network.Destroy because the network view 'AllocatedID: 51' could not be located.
There may very well be no way to do this. If so, what's the "right" implementation to handle this case? I guess I could hide the bullet on the remote side and set its script inactive, and then let it be destroyed when the creator copy says so?
– TheMaster42