Hi all,
I’m currently doing a project where im developing a chess game. What i’m trying to achieve now is that i have an animation done on a moving bear. The animation is that the bear is moving forward (one cycle for example the bears leg moves forward, backwards and back to neutral position).
But when i script the bear to move from one location to another, the bear appears to be sliding across the floor. And if the moving distance isn’t far enough it wouldnt even complete one animation cycle. Is there a way where i can set it such that within the moving distance, the bear has to complete a certain number of animation cycle?
This has been troubling me for awhile now. Thank you all so much for helping! >_<
The easiest way most likely is to set the walking animation to loop and then once within a certain distance of the target position play the halt animation. Additionally you will need to try the correct value for the animation playback speed and/or the move speed.
It seems like you are not using Mecanim though. Mecanim itself is based on animation driven movement, which means you can animate your object in your 3D application and in Unity it’ll move based on the animation. Note that this is not an in-place-animation approach as you might be used to. Instead you will animate the real walking/running/whatsoever cycle including the distance travelled. In Mecanim itself you may then set the playback speed, which will directly affect the movement speed as well. Plus you can easily blend between animation states as well.
Halt animation? hMm… Actually im wondering if i could set the amount of time the animation will loop.
Example:
int x
SET ANIMATION TO LOOP x TIME
So at least i know that if my chess moves 5 steps i just loop it 5 times… This way i can ensure that all the movement speed will be the same. Is this possible? >_<