- Home /
Leg locomotion issue on crawler vehicles
I have gone desperate for solutions on how to setup a proper locomotion system on vehicles that has crawler legs: This one --> https://www.dropbox.com/s/lqa5qrrzy97dwuw/Walker.png
I am using Runevision's Locomotion System. But I fail to get it right because the legs just flails about, dislodges and fails to stay level with the vehicle it's attached to.
The way I have setup this vehicle is that it rolls on invisible wheel colliders that makes it move. And I have attached the legs on a child GameObject inside the vehicle with a locomotion system to simulate the walking. But it just won't behave itself. Any help?
This is a modeling and not a scripting issue but I have to comment on the design of those legs- the knees look weak and unworkable. They should be way bulkier; and maybe have some visible hydraulics underneath. Look at the tank from Ghost In the Shell, for inspiration- I know that's a futuristic anime style and yours is more dieselpunk, but the physics of the masses involved are the same. (Apart from the legs though, I love the design!)
Answer by Kiloblargh · Jul 10, 2013 at 11:26 PM
I would just animate parent objects of the legs in a fixed walk cycle, and then rotate each of the actual leg joints relative to their parents by some pre-calculated fudge factors times the height of that foot off the terrain.
Well, the issue here is that I cannot animate the parent object because it is built around a complex vehicle script that includes other moving objects that relies on physics.
I want a solution so I can have the legs to move in tandem with the vehicle that it is connected to.
Well, I could do the option which is to drop the locomotion topic for the sake of more assistance.
And use a simple animation system that will switch between states of walk cycles based on the movement of the vehicle. So, can anyone help me with that?
I have made 4 animations of the legs which is forward, reverse, turning left and right. But how would I make them animate and blend with the direction the vehicle is going?
The legacy animation system tutorial has an example of animation blending; in general it's kind of a pain in the ass to get working right at first but it's definitely doable. Lerp and InverseLerp and trial and error.
I would ditch the Locomotion System- it's made for legs where the hip is above the knee is above the foot, your legs have the knee above the hip, which confuses it. What I'm saying is- forget I said parenting, don't do that- you make invisible legs that you'd animate just like normal legs walking on a level surface, and then you have a script that each frame first positions the visible legs exactly the way the invisible animated ones are positioned, then measures from each invisible foot to the ground and adjusts the rotation of the joints on the visible legs to raise or lower them accordingly.
Ok. So how would I go about and make sure so it will work how I have set it up? The legs are supposed to be attached as a child in the vehicle. So how do I set it up so the legs will play the animations and blend them due to angular and directional motion?
Your answer
Follow this Question
Related Questions
Vehicle (tank) for my character 1 Answer
Weapons on vehicle 1 Answer
Raycast align with ground normal 2 Answers
How to turn of collision for the player 1 Answer
Boat movement, driving and animation 1 Answer