I am new to unity and I am following a tutorial series online. I copied his script exactly but I have a very strange error. The error is on line 21 of my code sing System.Collections;public class Spawner : MonoBehaviour { public Ga - Pastebin.com it says “this” is an unexpected symbol. I find this very weird because I use “this” all the time. In fact I even used it earlier in the code. So how do I fix this error?
You left out a semi-colon, but aside from that the best thing to do is get rid of “this” entirely. It’s unnecessary and just adds clutter. The only time you need it is when distinguishing between class and local variables that have the same name.
–Eric
1 Like