C# - JS problem.

In C# i can do public class (Name) : (score)

That’s how I can transfer over my score from the Score script to another script in C#. How would I do that in Javascript?

Please let me know as soon as possible.
Thank You!

1 Answer

1

In Javascript the default access modifier is public. So you can access the variable from another script by calling

GetComponent(MyClass).MyVar;

Where MyVar can be the score.