Game Development Community

Is this possible in TGB (Anamations)

by Robert Carroll · in Torque Game Builder · 11/27/2009 (11:22 pm) · 1 replies

Hi, Im making a platformer, and need the gun to play an anamation when the mouse is down. Heres what I have
====
function platformerAnamTionsAIBehavior::setCurrentAnimation(%this)
{
	// Animations.
	if(%this.owner.airborne)
	{
		if(%yVelocity < 0)
			%this.owner.playAnimation(Gunstill);
		else
			%this.owner.playAnimation(GunShoot);
	}
	else
	{
		if(%xVelocity == 0)
		{
				%this.owner.playAnimation();
		}
		else
		{
			if(%this.owner.getAnimationName() $= "")
			{
				if(%this.owner.getIsAnimationFinished())
					%this.owner.playAnimation();
			}
			else
				%this.owner.playAnimation();
		}
	}
}

Is there any way to do this, by changing the airborn?

#1
11/27/2009 (11:26 pm)
btw I know it says a bunch of stuff about velocity and stuff but I just ignored it :) I know I have to delete those.