I'm attempting to use UnitySteer as my pathfinding script(s) while using mixamo motion-capture animations via the scripts they've provided. Individually I can get them each to work; separately I get some weird results. It seems (sometimes) that if I have more than one instance of the animation running one of them will play through once and freeze at the end; even with the animation set to loop.
Thats a small issue and one I can probably sort out on my own. The real issue I'm having (and it could very well be because I don't entirely understand the UnitySteer autonomous vehicle script) is that the Mixamo driver script was written with the assumption that the character is player-controlled. Specifically: it looks for keystrokes to cue the animations. I've tried various forms of CharacterController.velocity to make it work, but I've been getting strange side effects such as moving sideways while walking forward or randomly flying 80ft in a random direction.
I'm posting the mixamo script below..It's rather lengthy, but seems to be fairly straight forward. It does rely on another mixamo script, but from what I've seen that one's completely devoted to regulating the animation's motion-capture side effects(mostly forward movement in the actual animation).
Is there any simple way to get unitySteer to work with this? I've done what I can think of, and I'm sure there's some simple solution I've neglected to consider.
I'm unfamiliar with Mixamo's needs, but it would seem that what it needs is to know in which direction your character is moving and if it is running. If so, you might be able to create something like VehicleLookAtOverride, which caches the Vehicle's last N forces applied. You could then judge if the vehicle is moving forward or sideways by the change in vectors, which would replace your if (Input.GetKey(KeyCode.W)). You would determine if the vehicle is moving at a running speed or not based on its Speed property, checking against whatever threshold you take to mean running, which would replace the LeftShit/RightShit comparisons.
If you don't care about sideways movement - and it appears from the code sample that A/D are only evaluated to rotate the transform - you could just get away with checking the vehicle's speed. Anything above a certain threshold (say, 0.2f) would mean forward movement and you blend into the walk/run animations (the equivalent of pressing W).
This of course depends on what computer.ComputeRootMotion() does, so you may want to review it as well.
answered Jan 07 '11 at 08:59 AM