Here is the script
#pragma strict
private var levelUpScript : LevelUpSystem;
function Start ()
{
levelUpScript = GameObject.Find("First Person Controller").GetComponent(LevelUpSystem);
}
function OnTriggerEnter (Col : Collider)
{
if(Col.tag == "Player")
{
Destroy(gameObject);
levelUpScript.currentXP += 10;
}
}
Do you have a file called LevelUpSystem.js?
Are you mixing c# and JavaScript/UnityScript?
You really should use generics with GetComponent so it returns the expected Type and not type of Component.
levelUpScript = GameObject.Find("First Person Controller").GetComponent.<LevelUpSystem>();
We are missing some information to help you with this.
@Landern Hi!I am not rlly into scripting and stuffs like that and i got this script from youtube.I’ve tried your ideea and unfortunetly didnt work.If you know a way i could learn scripting i would rlly appreciate if you tell me :D.