- Home /
How to add a NetworkView with its ID to an instance?
I'm having problems when I try to destroy AN INSTANCE in my multiplayer game, not a GameObject which already exists since the creation of the game.
The fact is that I've got my Empty GameObject for determining the position of the instantiation through the Network.
My prefab is intantiated and both (server and client) watch the object correctly with its animation.
I print the NetworkID before and after of making a NetworkDestroy and print returns in the console the NetworkID of the EmptyGameObject where the instance was created. So, I suppose that I destroy the Empty GameObject, not the instance.
Do you know how to destroy an object through the network?.
The pair: Network.Instantiate & Network.Destroy doesn't work for me with instances of prefabs but yes with objects that already exists in the game since the start of the game.
The prefab should have a NetworkView component too?. I've added one to my prefab but has an ID=0...It's strange:an instance takes its NetworkID when it's instantiated and not before?...
I can't find my solution.
Any link which works?. I don't know what else do...Do you want my code?
Thank you very much.
Your answer
Follow this Question
Related Questions
C# yield in server-side Co-Routine 0 Answers
netcode for gameobjects camera + Input override 0 Answers
Supress initial OnSerializeNetworkView state update 0 Answers
Very simple networking question 0 Answers