- Home /
The question is answered, right answer was accepted
Walk/Run right animations seem hard to come by
I did the Mecanim tutorial with the walk/run left/right animations but any animation packs I've bought don't have these types of walks or runs. In Maya can I turn a straight forward motion into a turn? How do people typically create blend trees for walks?
I don't use Blender only $$anonymous$$aya and don't animate
Answer by meat5000 · Aug 05, 2014 at 03:06 AM
Time to learn?
Some people split motion between lower and upper body. Check the AngryBots tutorial.
I don't do that. I Blended a walk and run animation. Same number of frames, footsteps synced.
Next I created a walk round in circle left and right, same frames, synced footsteps and blended these with my walk/run blendtree.
So with varying degrees of Joystick tilt I can achieve Rest->Sprint smooth changing and can turn left and right while walking running or at rest.
Blending animations requires synchronisation of motion in each blended clip.
The Blendtree doesn't look very elegant but it's smooth as silk and the character looks great with the Blended animations.
Thanks for the BLend Image i vae similar but not as DEEP as ypurs loooks Good
any incite to the C# used to implement this?
Anim.SetFloat ("Speed", $$anonymous$$athf.Atan2 (v) 180.0f / 3.14159f, DirectionDampTime, Time.deltaTime); Anim.SetFloat ("Direction", $$anonymous$$athf.Atan2 (h) 180.0f / 3.14159f, DirectionDampTime, Time.deltaTime); Anim.SetBool ("Running", Input.Get$$anonymous$$ey ($$anonymous$$eyCode.LeftShift));
etc.....?
Its just the same as for 1 animation. The whole tree can be controlled with 2 parameters, so anim.SetFloat is usually the one to use. Tried digging out the script but its an old project, cant find it.
Basically the Characters AnimController script should act like a bit of a joystick, mapping input to output. Dont hard link any input in that script.
This way, anything is free to reference your player and you can feed it movement with a simple Vector2. Useful for cutscenes and other interaction. Also keeps the animation script simple and responsive.
Adding this in for a better overview of the above technique.
This answer describes the script which runs the above blend tree.