Client - Side animation

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

vjawa

New Member
Apr 25, 2004
2
0
0
I've been using the runtime for a couple of months now. I've had issues with it but most of them have been solved over time.

My major problem now is client-side animation for bots. In particular the movement animations.

I've used the MyFirstExample ExamplePawn.uc method to base the code structure for my bots. I have a simulated PlayWaiting() and PlayMoving() functions which get called on the client for the bots. However, when it comes to moving, the Walk/Run animations don't loop like they should. The animation gets stuck on the first frame of the required animation and then slides to the next position

Here's some of the code


Code:
simulated function PlayMoving()
{
	MovementAnims[0] = AnimationNames[12];   //Walk animation
	MovementAnims[1] = AnimationNames[12];   
	MovementAnims[2] = AnimationNames[12];  
	MovementAnims[3] = AnimationNames[12];  
	TurnLeftAnim = AnimationNames[12];        
             TurnRightAnim = AnimationNames[12];      	
}

//Callback by the engine when the player is not moving
simulated function PlayWaiting()
{
	log("Play Waiting Called");
	ChooseIdleAnimation();
	LoopAnim(AnimationNames[CurCivAnim], 1.0, 0.3);

}

I'm not using SetAnimAction because I don't need to (or do i?). Shouldn't defining these functions be enough? The internal pawn functions call the playwaiting and playmoving but the moving animations don't play or loop.

Has anyone had this problem before. Is there any other example that I could see to help me solve this problem?

Thanks.
 
Last edited:

vjawa

New Member
Apr 25, 2004
2
0
0
I found the solution to my problem. I want to put it down here for anyone to see. There is a small funny thing about runtime. The MovementAnims need to be set to valid animations in the default properties. Just setting them in the PlayMoving the first time doens't work. Something to do about caching the animation name the first time and if there is nothing - it doesn't update itself