Issue with setting two separate scores in HUD

You should use code tags for your code.

var like = this;

It would make your snippet much more readable and I wouldn’t have to count the rows to get to the error on line 26 …

All in all, you messed big time, it’s clear as day you don’t really know what you’re doing.
So let’s start from the beginning.

  1. Your class is called ‘Connector’. It connects what exactly? This is just a question, not a problem in itself. You can probably choose a better name for this script.

  2. You declare two field variables enemyScore and collectionScore and these are of type Text, so I’m guessing it’s the visible part of your GUI with which you actually present the score values.

  3. However, there are no values themselves.

  4. In Update, you suddenly declare another local variable with the same name of enemyScore, and this has consequences. Namely, it hides the already existing class field because it has the same name. And then you assign to this variable some value that you fetch from a component on another object, via GameManager singleton. I can’t tell if this is correct.

  5. Now enemyScore.text probably can’t work, because the local variable enemyScore is of type int and has no text property.

  6. For a similar reason, collectionScore.ToString() probably doesn’t return anything meaningful, because collectionScore is a class field which is of type Text, so it probably only returns the word “Text”.

Pretty bad all around
1/10

But we’re here to help. However, there is not much else I can help you with.
If you don’t understand your errors, all I can say is that you need to achieve a better command over programming.

Really the basics; what is left and what is right. How variables work, how scopes work, the classes, the objects, fundamentals of OOP, as well as the nominal C# syntax … If you knew that, you would understand exactly what your instructor did and why it worked.

Feel free to ask something specific if that helps you get a better grasp on this problem.