Im calling a variable from another script and added 50 to my CurrentMoney when i destroy the rigidbody , but this comes up …
Script :
function Start () {
CurrentHealth = MaxHealth;
}
function ApplyDamage (Damage : float) {
if(CurrentHealth < 0){
return;
}
CurrentHealth -= Damage;
if(CurrentHealth == 0){
Destroy( gameObject );
var MoneyScript: MoneyScript = GetComponent(MoneyScript);
MoneyScript.CurrentMoney + 50();
}
}
ive done alot of research for the past half an hour or hour but still cant find any soloution