The 3D camera no longer exists -> AudioListener Spam

Hey, I am encountering a problem.

I am in a 2D environement!

This is the scenario: If a player reaches the goal he is able to choose what he wants to do next. One option is to repeat the level. Therefore there is a button which will just load the SAME scene again.

If he retrys the level now and draws a line there is a warning:

The 3D camera no longer exists…if you have changed scenes, ensure that SetCamera3D is called in order to set
it up.

Therfore I have a script which says that the camera should not be destroyed on load.

The game pretty much works again and the error above will not appear anymore BUT I then have 2 (3,4,5 depending on how many times I reloaded the level) Aadio listeners in the scene and get warnings spammed which probably affects the games performance because the more I retry the level the more laggier it gets.

If you need any further information be sure to leave a comment!

If you have a solution or suggestion it is really appreciated.

Kindly regards,
René

Is your listener in the singleton object? (an object that you save and don’t destroy on level reset).
If yes, then you should have an if check to see if it’s already alive. If it is, kill it.

you need to use this line…

void Start () {
	VectorLine.SetCamera(Camera.main);
         // or
            VectorLine.SetCamera3D(Camera.main);
       }