So, here's how it's done. function addingExp(){ var level = gameObject.Find("Player").GetComponent(Level); level.experience +=50; } Explanation: gameObject.Find("Player") Finds the object the script it attached to. Player is the name of the object, note that the name has to be in quotations. GetComponent(Level) Finds the name of the script. level.experience +=50; level is calling the variable that we just set above, experience is a variable within the script that were calling on in the code.
Learn to create games, a blog at a time.