Playing animation


I want to learn how can i play and stop animation. Second, i want to play animation specifically. Such as, there is a jumping animation. When i press "j" it jumps when i press "k" it jumps but want to stop it in the middle of the animation (for this example, the top)


Re: Playing animation

This project shows how to play animations: ... ame-sample
But this isn't the standard way to play animations on characters. Animations are
abstracted with mannequin. Learn more about it here:
It requires more setup, but gives you more flexibility.
Most cryengine templates are using mannequin and are good examples for basic usage.
For inputs read about "Action maps" here: ... Game+Input
The templates also use action maps.

Re: Playing animation

So if you just want to start and stop animations you could use this code:

Code: Select all

CryCharAnimationParams animParams;
animParams.m_fPlaybackSpeed = animationSpeed; // your animation speed
animParams.m_nFlags = CA_LOOP_ANIMATION; // flags to specify the animation

// pCharacter should be your ICharacter
pCharacter->GetISkeletonAnim()->StartAnimation(m_animation, animParams);

Everything more complex can be seen in the C++ ThirdPersonTemplate or in the GameSDK.

Good Luck

Who is online

Users browsing this forum: No registered users and 1 guest