how would i send a true or false var from one script(A) to another (B) while script A is on one game object(object A) and script B is on another Object (Object B).
then how would i send a transform var from those two?
how would i send a true or false var from one script(A) to another (B) while script A is on one game object(object A) and script B is on another Object (Object B).
then how would i send a transform var from those two?
Hi, use this:
//Script A
var damage = 5;
var targetObject : GameObject;
function Awake () {
targetObject = GameObject.Find(Object with the Script B);
}
function setDamage () {
targetObject.GetComponent("Script B").thisValue -= damage;
}
//Script B
var thisValue = 50;
function Update () {
print(thisValue);
}
Hopes this can help you.