Need some help with making a good 3D procedural mech leg system.

Godot Version

4.5 Stable

Question

Hello gents,

So i’m currently in a gamejam and as part of my game I’m making a mech that has moving legs, them actually moving the body is optional. I’ve gotten the model imported from a .blend file and i have a physical skeleton and everything is ready, except…

How do I make the legs walk?

I can’t really find a good way to have the legs move in a walking motion, i may be able to add rotation forces to all the bones, but there must be a better way right? Any thoughts?

I might be wrong here, usually for procedural animation people would use SkeletonIK3D instead of PhysicalBone3D which more suitable for ragdoll. SkeletonIK3D is deprecated but still can be used for current version.

Video on procedural animation

1 Like

I found this tutorial https://www.youtube.com/watch?v=VasHZZyPpYU very helpful. It describes preparing animations such as a walk cycle in Blender and then exporting them to Godot.

I would use inverse kinematics and make the foot follow a half circle motion (moving like a circle in the air forward and then staying on the floor until the body moves further).

If you need collision with the legs, just attach static bodies.

If you need the legs to interact with physical objects them this is more complex. You would need to have rigidbobies atached together with constrained joints (to make the leg) and you also would have to set dinamic target angles for the joints. Use Jolt Physics if you go for this

This seems like the way to go, sad that i won’t be able to realistically simulate the mech, but having it move on it’s own seems like the way to go regardless. Ty :3