function OnMouseUp()
{
// I want to +1.4 onto a varible on a nother script.
}
other script
var health = 0.0;
function Update()
{
if health <1.0
var changecol : GameObject;
renderer.material.color = Color.red;
else
//do nothing
}
function OnMouseUp()
{
// I want to +1.4 onto a varible on a nother script.
}
other script
var health = 0.0;
function Update()
{
if health <1.0
var changecol : GameObject;
renderer.material.color = Color.red;
else
//do nothing
}
Is the script attached to the same gameobject?
If so,
//I'd set the reference on awake so you don't have to each MouseUp
var otherScript : otherScript;
function Awake()
{
//Grabs the other scripts reference
otherScript = GetComponent("otherScript");
}
function OnMouseUp()
{
//Use periods to access other scripts variables and functions
otherScript.health += 1.4;
}
Dident think of that.
Cheers you saved my Job
No problem :). Glad I could help. And its always something easy thatโs just been looked over lol. Happens to me on a daily basis ><