I can’t find answers thru Google like I normally do for this, so I’m here looking for someone with more experience in dynamically altering transforms. I’m creating a game with modular creatures, where you can hotswap the body, forelimbs, hindlimbs, head, etc., and I’m trying to keep the feet in their default position on the ground. The issue is, the legs vary in height, so the body Z location and pitch rotation need to adapt when the legs are swapped out. Included is a diagram of the setup with the unknown variables, and some screenshots of what I currently have setup (that obviously isn’t working). In addition, I need to figure out 3 other issues that are related, that I’m at a loss of how to solve. In list format, this is what I’m stuck on.
- How to set body rotation and location based on length of the legs and distance between legs
- How to make the feet face the surface normal angle of the ground (I have a simple function that traces straight down, but I need to adjust it based on the surface normal under each foot)
- How to lower each limb when the character is standing on an angle so the feet actually touch the ground (I understand that I need to adjust the relative Z location, but the solutions I’ve tried aren’t working)
- A way to dynamically adjust the mesh rotation to the surface normal of the ground, while maintaining the pitch from the varying leg heights
Visual aids (I’m aware some of the roll/pitch rotations are swapped, for some reason the import settings from blender didn’t take):
I think that’s everything relevant, but I’ll post more if needed