This lecture made no sense to me (early returns)

All that’s happened is the code has been needlessly moved around multiple times which has now broken the game (which was working for me) and I still don’t understand what early returns are. I’ve checked the code changes for the lecture and it doesn’t represent what was talked about.

My question is, if I re-write everything in green on the lecture change log, will my code work again?

All the lessons up until now have been easy to follow and clear. This one was neither.

Hi Ryanam,

Have you already rewatched the lecture at least one more time? Maybe it’ll make more sense then.

I don’t know what errors you get but NullReferenceException means that a reference (“link”) to an instance is missing. Double click on the error message to see to which line in your code it is referring. If you exposed a field in the Inspector, make sure that it’s not empty.

If you have issues in your code but wrote your code as Ben and Rick in the past lectures, you could go to the GitHub repository. Instead of just writing the green lines again, click on the three dots or look for an option to see the whole script. When you see the whole script, you could click on the “Raw” button and copy and paste the script. Or you could use that script and compare it to yours.

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

Privacy & Terms