Author Topic: Animation plays twice?  (Read 1119 times)

Code: [Select]
if(!%obj.isHupLeft)
{
%obj.playthread(3,shiftaway);
%obj.isHupLeft=1;
}
else
{
%obj.playthread(3,leftrecoil);
%obj.isHupLeft=0;
}
For some reason, even though I talk checked it to make sure the function was only being called once at a time, it plays the animation twice in rapid succession.

Code: [Select]
if(!%obj.isHupLeft)
{
%obj.playthread(3,shiftaway);
%obj.isHupLeft=1;
}
else if(%obj.isHupLeft)
{
%obj.playthread(3,leftrecoil);
%obj.isHupLeft=0;
}
Would else if work better?
« Last Edit: July 29, 2013, 06:01:11 PM by Advanced Bot »





I think we'll need to see more of the code

Code: [Select]
if(%obj.isHupLeft)
{
%obj.playthread(3,leftrecoil);
%obj.isHupLeft=0;
}
else
{
%obj.playthread(3,shiftaway);
%obj.isHupLeft=1;
}

Try this instead.

People above, how will messing with the if statement change anything?

OP, it could just be a problem with the animation itself. Have you tried playing the animation manually (using console) to see if it plays twice?

OP, it could just be a problem with the animation itself. Have you tried playing the animation manually (using console) to see if it plays twice?
Finally something that makes sense.
Messing with the if statement won't change anything, people.

Code: [Select]
if(!%obj.isHupLeft)
{
%obj.playthread(3,shiftaway);
%obj.isHupLeft=1;
}
else if(%obj.isHupLeft)
{
%obj.playthread(3,leftrecoil);
%obj.isHupLeft=0;
}
Would else if work better?
This:
Code: [Select]
if(%this)
{
echo("True");
}

else
{
echo("False");
}
Does the exact same thing as this:
Code: [Select]
if(%this)
{
echo("True");
}

else if(!%this)
{
echo("False");
}