|
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.
(comments are locked)
|
|
Interesting problem. 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. VehicleLookAtOverride is giving me errors saying that autonomous vehicle doesnt have a LastRawForce value, but the note about a rigidbody w/ collider instead of a character controller was a great help. I'll keep looking at VehicleLookAtOverride and autonomous vehicle and see if I can get it working. Thanks for your help.
Jan 07 '11 at 06:14 PM
digitalConundrum
That's because it depends on the branch b2.1 where it is. It's also meant only to give you an example of how you'd write a behavior that expands on the information from AutonomousVehicle, it's not something that'll solve your integration problem.
Jan 07 '11 at 06:52 PM
Ricardo
(comments are locked)
|

As a side note, I really wouldn't use a CharacterController unless absolutely necessary - they're significantly more expensive than just using a collider: http://www.arges-systems.com/articles/47/handling-slopes-with-autonomous-vehicles