how to pass the variable from different script?

Hello,friends.
I am a new in UNITY 3D,so I am learning now.And I encouter a problem:
I have two script files,one is wrotten in js,the other is wrotten in c#; then the problem is how to get the value of the variable from the c# scripts into js cripts .
If you can take an example and display your code,that would be great helpful.Thank you for your focus.

this question has been asked many times on this forum, try a search :slight_smile: Hint: GameObject.Find GetComponent

Use setters getters.

Setters are set functions for example :

public void setVariable(int x){ var = x; }

Getters are get functions that return the variable, for example :

public int getVariable(){ return var }

Then use find component to get the script you need and then call the get function to get the variable ( later on you can use the set function to set the variable to a new value )

Get it . Thank you very much!

great!!