I keep getting this error each time I try adding the LevelManager?


so there’s the error on the bottom and I renamed the level manager to see if that worked I even deleted the levelManager multiple times I even tried removing the script to see if that worked can somebody please help I would love it if you can.

Can you post your Bricks.cs script please.

OK here it is

Hi Ayman,

Just as a heads up, it’s easier if you copy/paste your code into your posts and then apply the code formatting characters before and after. Screenshots are however useful for errors or details from the Unity editor.

Regarding the issue you are having - your Bricks.cs script is referencing an object of type LM. As you have mentioned you have been renaming things I suspect this is going to be your issue. If you just change the name of your class, anything that was previously referencing isn’t going to know what it is anymore.

To give you an analogy, you move house but dont tell amyone, then wonder ehy you dont receive letters from your friends :slight_smile:

I would recommend not abbreviating also, so, to resolve;

  • name your LevelManager GameObject “LevelManager”
  • rename the LevelManager script filename to “LevelManager.cs”
  • rename the LevelManager class to “LevelManager”
  • update all references where you are using it to reflect the correct type name, e.g “LevelManager”

Hope this helps :slight_smile:


See also;

2 Likes

thank you so much

1 Like

You are very welcome :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms