ERROR You have missing MonoBehaviours on your gameobjects!

Options
I'm getting this error logged when the player changes classes and respawns. Due to the nature of the middleware I'm using, I have to destroy the player's game object and create a new one when the class changes. When I create the new player game object, a new photon view is added with the same view id as the old player's view. The old game object is destroyed with DestroyImmediate before the new object is created.

I suspect that somehow using the same view ID as the old view is the issue but the middleware keeps track of view ids per player and I'm afraid if I just create a new view id, it's going to cause other issues. Is there something I need to do to basically "move" the photon view from the old gameobject to the new one?

Thanks in advance

Comments

  • strangegames
    Options
    I eventually found the problem. I was calling the function to delete/change the player from the RPC function on that player. This had the result of deleting the photon view which was running the delete function. Changing it to delete the player during LateUpdate fixed the problem by allowing the RPC to finish out before trying to delete the photon view that called it.