Receiver shouldn't be nil error when restarting a level

I’m trying to restart a level and have first used the unload code to do so.

The error here is this:

image

Would be grateful if someone explained what this means.

It means that the self.unloaderis nil.
Check that your sender is not nil when assigning to your variable self.unloader. (Or anywhere else where you assign the variable)

Also note that posting screenshots isn’t the best option. It’s not searchable for future users, and it’s not easy to modify for users that wish to help.
Add a code section surrounded by 3 apostrophes: ``` code ``` and it will format like Lua code automatically:

local p = "test"
2 Likes