Unity 5.5
I cannot call LoadLevel from LevelManager in the LoseCollider script
I followed the steps in the video and double checked my spelling but it keeps giving me an error. Can anyone see anything I can’t?
Thank you
Unity 5.5
I cannot call LoadLevel from LevelManager in the LoseCollider script
I followed the steps in the video and double checked my spelling but it keeps giving me an error. Can anyone see anything I can’t?
Thank you
Have you tried dragging the gameobject that contains the Level manager script onto ‘giveMeLevelManager’?
On first looking at your code, everything looks good…
But something is niggling me about your level manager script…Like, are you sure there is only one level manager in your game? (Again, something looks off about level manager, just can’t put my finger on it…)
Hmm, so I looked in my Start scene and noticed that I had a “LevelManagerScene”. I changed the name to LevelManager, identical to the Game scene (the scene in question). It works now. I am a bit confused though. Could you help me understand what happened? Sorry if this is a bother.
Thank you for the help too! I appreciate it.
Would need more information, maybe even screen shots of your scene, what objects are in the start scene. You have a levelmanager scene? What scene was the current problem you intially posted in?
So the scene with the issue was the game scene. When I changed the “LevelMangerStart” Object (which had the LevelManager script attached to it) in the Start scene it made the issue go away.
So strange…I guess as long as its working now, thats fine. But:
The name of the gameobject, previously called LevelManagerStart but now called LevelManager, that shouldn’t effect your bit of code:
public LevelManager giveMeLevelManager;
Because for the above, you are creating a variable of type ‘LevelManager’, (the type being the script, levelmanager. Shouldn’t and wouldn’t have anything to do with the gameobject LevelManagerStart.
I don’t know if you can remember, but when you encounter the initial problem, did you drag the script into the inspector where Give Me Level Manager is? If you dragged the ‘script’ instead of dragging, say the Gameobject, formerly known as LevelManagerStart but now known as LevelManager, then you may have encountered the errors you mentioned.
I think, if you rename the LevelManager gameobject back to LevelManagerStart, then drag LevelManagerStart onto the Give Me Level Manager part in the inspector, I think your code should still work?
Thank you for all your help! I really appreciate it!