Hello guys,
I thought that I had came up with a method of changing the hero sprite/ship/paddle/bat whatever you wish to call it by accessing the SpriteRenderer and changing to the appropriate index of the sprite using this code:
However using the above code I get the following error:
- NullReferenceException: Object reference not set to an instance of an object
PaddleMove.Update () (at Assets/Scripts/PaddleMove.cs:46)
For some reason the line Number at Pastebin is slightly different to actual code (??) and the problem is really on Line 44. And I can’t understand why it is throwing up this problem. Woulld any of you guys know what the problem is and how to rectify it?
Thankyou in advance.
Regards.