hi there
I have a problem and i can’t figure out what the problem is.
I have a script with a var that I want to call in another script. I guess my coding is wrong cause i get this error “Assets/script asteroid.js(25,53): BCE0019: ‘lives’ is not a member of ‘UnityEngine.Component’.”
here is the var script called “script player”
var lives : int = 3;
here is the other script called “script asteriod”
function OnTriggerEnter (other : Collider)
{
if(other.gameObject.tag == "Player")
{
other.GetComponent("script player").lives -= 1;
}
}
any help will really be appreciated