Kiekos
Member
|
Animation parameters
Hey! This is a question from my friend who is involved in the project with me and is responsible for the animation.
In the editor when placing an object on the world you can edit its parameters including animation. So for example there's that string parameter "anim walk" (if I'm correct) and it has "walk.anim" file set to it. Now when in code I call .actionMoveTo(pos) the animation is executed while the character is moving.
The question is: when I create a new parameter like "skill 1" and set an animation to it ("skill_1.anim"), how do I call it in code?
|
|
12-07-2013 10:55 PM |
|
Rofar
Member
|
|
12-08-2013 04:50 PM |
|
Kiekos
Member
|
RE: Animation parameters
Alrighty then, I'll try that surely.
But there's one more thing that bothers me. How do I properly "align" animation speed with character movement speed and how to control the speed value?
Let's say I want my character to run faster when he equips some item. I'd have to make him go faster but also increase the animation speed so that his feet don't "float" in the air (if you know what I mean).
|
|
12-22-2013 11:24 PM |
|
Kiekos
Member
|
RE: Animation parameters
No one's got any ideas on that character movement and walking animation speed?
|
|
12-29-2013 10:50 PM |
|
1991mirec
Member
|
RE: Animation parameters
you don t increase the animation speed.. you creat a new animtion for running where his moving with his legs will be faster.. at least thats how we have it..
|
|
12-29-2013 11:43 PM |
|
Seba
Member
|
RE: Animation parameters
In defualt character class you have:
Quote:speed = 8.0f;
If you have some extra animation you can scale time to get better result:
Quote:cskel.animate(sac_Jump, ctrl.timeInAir()*0.9, LerpCube(0,1,jump),true);
|
|
12-30-2013 12:10 AM |
|
Pixel Perfect
Member
|
RE: Animation parameters
I'm not using the default character class or the standard animation set but a variant of my own but essentially I calculate the anim time as a factor of the NPC's speed as follows:
Code:
// Calculate the animation speed based on the speed.
animTime += Time.d()*(m_fSpeed/m_fMaxSpeed);
// Call the animator update to take care of the npc animation
m_pAnimator->update(animTime);
|
|
12-30-2013 12:39 AM |
|
Kiekos
Member
|
RE: Animation parameters
Quote:you don't increase the animation speed.. you creat a new animtion for running where his moving with his legs will be faster..
That's surely not what I want to do considering that I will have various items changing the speed and there will be dozens of combinations...
@Pixel Perfect, that seems like the solution. Well, it was predictable - changing the duration of animation cycle will change its speed, right?
|
|
12-30-2013 07:03 PM |
|