Switching a scene on player death

You can’t call a bare function like that if it is in another script.

Use the instance you declare on line 14 and attempt to get on line 46.

WARNING: hairy lines like line 46 are the cause of VAST amounts of headaches.

Making the variable public and dragging it in is always a superior approach.

If you have more than one or two dots (.) in a single statement, you’re just being mean to yourself.

How to break down hairy lines of code:

http://plbm.com/?p=248

Break it up, practice social distancing in your code, one thing per line please.

“Programming is hard enough without making it harder for ourselves.” - angrypenguin on Unity3D forums

“Combining a bunch of stuff into one line always feels satisfying, but it’s always a PITA to debug.” - StarManta on the Unity3D forums

Remember the first rule of GameObject.Find():

Do not use GameObject.Find();

More information: Regarding GameObject.Find · UnityTipsRedux

More information: Why cant i find the other objects?