Dynamic Animations: Inverse Kinematics

Many prominent engines utilize IK (Inverse Kinematics) in their games to make dynamic animations and more realistic humanoid behavior. For my game, I’m currently trying to make some simple dynamic gun holding animations using IK.
https://gyazo.com/981c5b1d75c2d1edd99329655872f13c
This is what I have currently, I haven’t found a way to implement it into my motor manipulation or if this method is even the proper way I should be doing it.
My goal is to reach this:

At this point it would be very simple and just require the movement of the target points. Would you be willing to donate some tech tips @Adv3rtize? All I require is the arms part.

If code of the current method I’m using is required, I will happily provide it, though I don’t believe it will work for humanoid implementation.

2 Likes

Doesn’t the Roblox Animation plugin have IK built in now? You might be able to find it’s codebase and see how they’re doing it. Not sure if they’re doing some kind of trickery to make it work or if it’s a straight Roblox Lua implementation.

1 Like

There are straight lua implementations, yes the animation editor now has an IK dragger tool but that is not helpful in making real time animation that can be dependent upon environment slopes etc.

After doing further research and editing the script provided by @WhoBloxedWho, I have accomplished my goal.

The solution can be found here.

2 Likes

I was about to send you my thread :smile:

1 Like

Thanks! I may PM you later, the arm manipulation part works like a charm but I might need some help for multi elevation foot planting.
Current progress:

https://gyazo.com/d86cc9c060cad22ef8ea0c64c9e794da

For foot planting I suggest raycasting to find endpoints for the legs when standing. If the player is moving around, you can either disable the IK or set up an animation cycle for the endpoints based on which direction the player is moving relative to where they are facing.