//This script is in C#
public GameObject PlayerScript;
PlayerScript= (CollectPapers)gameObject.GetComponent();
//noted that CollectPapers class is made in javascript
//This script is in C#
public GameObject PlayerScript;
PlayerScript= (CollectPapers)gameObject.GetComponent();
//noted that CollectPapers class is made in javascript
I’m assuming ‘PlayerScript’ is a script/class. I’m assuming it is on the same game object as the script above.
public PlayerScript playerScript;
void Start() {
playerScript = GetComponent<PlayerScript>();
}
I’ve made ‘playerScript’ public bacause you did in your code above, but typically it would be private.