I created a question here last night and was led to the real problem behind that question but it still never got answered. And now more of the same problems are popping up in my unity file. I have tried googling everything I could think of and nothing that helped. I will post the link to the other question for reference at the bottom if needed. So here is the problem I am having:
When a “clone” of my player is instantiated the clone doesn’t have everything the original “player” has that was in my scene. Example one: When my player object respawns it should have an empty gameObject attached as a child that is tagged target. It doesn’t have it and now one of my enemies doesn’t “LookAt” with my script but it did before the player died.
Example two: I have an audio source that is attached to the player and a script that is on the player that tells where that audio source is to enable it. It works perfectly until the player respawns after dying, then I get a null reference exception because the part in the inspector where I had assigned it is set to none when I checked.
It’s like its not saving the prefab. And yes I first “applied” the “player” in my scene, then since that didn’t work I tried dragging and dropping the player prefab from the scene back onto the player prefab in the project folders area. It shows that its there in the project view and when I drag it back into the scene it has everything on it, but again when a clone is instantiated it doesn’t have certain things.
Here is the link to the previous question since it has some of the scripts (even though I don’t think it is a problem with the scripts):