Game Development Community

Change the Airborn to mousedown?

by Robert Carroll · in Torque Game Builder · 10/30/2009 (12:13 am) · 1 replies

Hi, I was wondering how I could edit this code bit to make it play when the mouse is down and stop when the mouse is up.
================
if(%this.owner.airborne)
	{
		if(%yVelocity < 250)
			%this.owner.playAnimation(playerJumpUp);
		else
			%this.owner.playAnimation(playerJumpDown);
	}
	else
	{
		if(%xVelocity == 0)
		{
				%this.owner.playAnimation(playerWait);
		}
		else
		{
			if(%this.owner.getAnimationName() $= "playerRun")
			{
				if(%this.owner.getIsAnimationFinished())
					%this.owner.playAnimation(playerRun);
			}
			else
				%this.owner.playAnimation(playerRun);
		}
	}
}

#1
10/30/2009 (12:14 am)
Im thinking just change airborn to mousedown and deleting all the velocity stuff but I don't want to mess it up too much.