I am trying to make a R15 movement animation system that is similar to the phantom forces.
This is my idea:
- Raycast on the ground on where the character’s feet is going to step on according to player input
- Based on the position that the ray gives, use IK to figure the bends of the leg to touch the ground.
I have the ability to do the raycast part but not the IK part.
Can somebody help me understand how to do IK with script?
Luckily for you for an R15 character there is already a community resource for a procedural foot planting system. The maths of the IK in that system also has been covered in this thread. Both of these methods use trigonometric methods to solve the angles of each limb which may be complex to understand especially when applying these angles to manipulate Motor6D C0 CFrames.
Alternatively, you can use my FABRIK Algorithm open source project which does not require trigonometry as it uses vectors manipulation to solve for the limb. However, currently, It’s difficult to make the leg bend in the correct direction which I’m planning to solve. Hopefully, you can start downloading the place files of each project and start experimenting to make your own conclusions on how to make an IK system.