Project Boost/56. Level Loading & Scene Management - Invoke

Problem - Invoke does not work. Unable to call the method LoadNextScene.
Script Error Message: "The Local function “LoadNextScene is declared but never used.”

Hi harmienta,

Check the position of the curly brackets and make sure that the LoadNextScene method is wrapped in the code block of the OnCollisionEnter method. Remember you can also look at the lecture code changes via the link in the Resources of each lecture.

Try to add new in front of the declaration of your rigidbody variable. If that does not work, rename it. In past versions of Unity, MonoBehaviour contained a variable named rigidbody. It probably still exists and causes a conflict with your own variable.

Did this help?

Yes to both:

The error I made re LoadNextScene is when refactored it, I chose function and not method. At least, that’s what I think.
Thanks again. :slight_smile:

According to your screenshot, the LoadNextScene method is inside the code block of the OnCollisionEnter method. Look for the closing } of the code block of the OnCollisionEnter method. It may not come after LoadNextScene.

How are you getting on with this, @harmienta?

Hi Nina,

I wasn’t able to use the Waypoint script but I’ve moved on in the tutorial. Thanks for your help,
Hector

This topic was automatically closed after 7 days. New replies are no longer allowed.

Privacy & Terms