Hey, I’m playing around with the iphone multiplayer tutorials. Now I’m trying to keep track of objects I instantiate on the network in order to be able to destroy them using Network.Destroy()
Anyway, here is what i do in C#:
This compiles all right, and when I run the game, my prefab is instantiated on the network properly.
Using the debug log, I can see that ‘o’ is of the expected type UnityEngine.Transform.
I’m getting a runtime error on the cast:
Cannot cast from source type to destination type
What am I doing wrong here? Can I not get a Transform of the instantiated object this way?
Also, you are going to run into problems using Network.Instantiate (or Object.Instantiate) on mobile because it dynamically allocates memory. Unless its just for the player, you should probably create a pool. I say to you 3 years later.