Ive been checking the help of unity and cant find what im looking for so im here XD sry if i just didnt knew how to search and it was there(if thats the case) im working in javascript btw ok the question is i have 3 objects top object bottom object mid object(i just made this to get the variables of the top and bot) ok the thing is when your mouse enters the top object this happens
function UpTrue(Enter:boolean)
{
if(Enter)
{
Count +=1;
}
else
{
Count =0;
}
}
count is declared like this at the top
var Count: int =0;
its the same for bottom so i was making this at the mid one thats the class taking all the info or at least suppossed to
var targetHand: GameObject;
var Up : MouseEnterUp;//name of script
var Bottom : MouseEnterBottom;//name of script
function Start(){
targetHand= GameObject.Find("Hand");
}
function Update()
{
if(Up.Count >= 1)
{
targetHand.animation.wrapMode = WrapMode.PingPong;
targetHand.animation.Play("clean"); // name of the animation clip
}
}
so what im trying to do basically is getting Count from object at top and bottom and if they are both 1 or at least for now if top is = 1 then play the animation in case it helps im getting the error NullReferenceException: Object reference not set to an instance of an object MidObject.Update() MidObject is the name of the script attached to the middle object
please any help would be really appreciated if you dont understand anything tell me and i will try to make it better so you can understand :S thank you very much\
since it seems like its kinda hard or something i dont know if theres a way to know the value of a function from other script >.< if theres anything tell me please thank you