Hello Right now im trying to use this. this is the script that is just receiving everything
var targetHand: GameObject;
var Up: MouseEnterUp;
var Down : MouseEnterDown;
var ContA : int = 0;
var ContB : int = 0;
function Start(){
targetHand= GameObject.Find("As_Hand");
Up= GameObject.Find("CubeUp").GetComponent(MouseEnterUp);
Abajo = GameObject.Find("CubeDown").GetComponent(MouseEnterDown);
}
function Update()
{
if(Up.EnterA == true)
{
ContA = 1;
}
if(Down.EnterB == true)
{
ContB = 1;
}
if((ContA == 1) && (ContB == 1))
{
targetHand.animation.wrapMode = WrapMode.PingPong;
targetHand.animation.Play("Clean"); // name of the animation clip
ContA=0;
ContB=0;
}
}
this is the code that calls EnterA this is another script EnterB is the same thing except that the var is named EnterB and the script is also named different but thats about it
var wasClicked : boolean;
var EnterA: boolean = false;
function Update()
{
if(Input.GetButtonDown("Fire1"))
{
wasClicked=true;
}
else if(Input.GetButtonUp("Fire1"))
{
wasClicked=false;
Deactivate();
}
}
function OnMouseEnter() {
if (wasClicked) {
Activate();
}
}
function OnMouseExit() {
Deactivate();
}
function Activate() {
EnterA = true;
}
function Deactivate() {
EnterA =false;
}
The animation is playing at first when A and B are both 1 then it loops infinitely any ideas? thank you very much