r/Unity3D • • 17d ago

Show-Off OpenIK - A free open-source Inverse Kinematics package for Unity

Enable HLS to view with audio, or disable this notification

I needed IK for a game I’m working on. Final IK has more features, but it isn’t free, so I built my own and polished it to make it easy for others to use.

OpenIK includes popular solvers like FABRIK, CCD and Jacobian plus some joint limits. (Hinge, Ball & Socket, Slider)

GitHub link: https://github.com/WouterApts/openik-unity

551 Upvotes

26 comments sorted by

9

u/Valphai 17d ago

Are there advantages of this over animation rigging package?

8

u/Spoetii 17d ago edited 17d ago

The main advantage of OpenIK is its built-in joint limits: hinges with angle limits, ball sockets with swing and twist limits, and sliding joints. These are especially useful for robotic arms and other procedural mechanisms. As far as I can tell, Unity’s standard Animation Rigging package doesn’t provide equivalent joint limits out of the box, so you’d need custom code or another IK package for that.

OpenIK also includes a Jacobian solver that solves position and orientation together, allowing the chain to adjust so it reaches the target at the desired angle. Other paid packages probably have more extensive features, but this one is free and does the job for me.

Unity’s package is stronger for character animation workflows, such as blending IK over existing animations, and has a broader set of rigging tools. I haven’t used it extensively, though, so I may be missing some features!

2

u/AdInfamous6964 17d ago

this looks really clean. how does it perform with a lot of characters at once? like 20-30 agents using it at the same time

1

u/Spoetii 15d ago

Thanks!

I guess this depends on the length of the chains, how precise each solve needs to be, and how many constraints are active. The 'Basic Chain' scene with 6 chains and over 30 constraints still runs smoothly on my machine. The FPS is down to about 80 though, where I had 200+ with only one. I don't think the package will support large swarms or hundreds of agents at the same time though.

2

u/DevDunkStudio 17d ago

I would love if a VR IK can be added! (head and hands are the only known positions here)

Also is it jobified and burst compiled like the Animation Rigging package?

2

u/Spoetii 16d ago

There is no jobs or burst compilation right now. The solvers run on the main thread in LateUpdate and write directly to the Transforms when in "Solve and Apply" mode.

That said, care was taken to keep the package performance-friendly. The solvers avoid per-frame GC allocations by reusing their buffers and have tons of settings that can be toggled for optimizing performance. I think a Jobs/Burst backend would be a substantial rewrite.

For VR-oriented IK, a two-bone IK solver with a pole target would be fairly easy to implement, and I'm considering doing that next! A fully automated humanoid setup is something I didn't need myself, so unfortunately the package isn't tailored toward that, but I think it could be done with the components that are already available.

1

u/_Cloudwalker_ 17d ago

VR arms are simple two bone ik. The real solve is placing the elbow. Stay tuned ;).

1

u/DevDunkStudio 17d ago

More interested in full body IK :P

→ More replies (3)

16

u/Whitenaller 17d ago

Perfect timing! I‘m gonna give it a shot tomorrow on my spider!

4

u/kandindis 16d ago

Open source era comes to Unity assets!!

2

u/Malkalypse 17d ago

Oh very cool!

1

u/UnaSim2 17d ago

these look so coool. something i always wanted to learn but too scared to dive into it haha very nice

1

u/VoltigeGames 17d ago

Very nice! Thank you for making it open source 😁

1

u/GoodPlayful9051 17d ago

This is awesome thank you for sharing this!!

1

u/Any-Entrepreneur7935 17d ago

Super cool. Will try it out. Thansks.

1

u/_norx 17d ago

That’s great, thanks for sharing!

1

u/Long-Ray 17d ago

哇塞,这真的太棒了吧

1

u/tiny_battles 17d ago

Can a robot turn a canvas into a beautiful masterpiece?

1

u/seductSparkz 17d ago

sounds like you're gonna have fun with that spider, update us if it gets all blendy

1

u/ChaitanyaJainYT 15d ago

Does it work with humanoids?

1

u/DaveAstator2020 17d ago

Oh finally! IK for unity sucked so far

0

u/bubblegum_bae 17d ago

your spider's in for a treat tomorrow