Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

FABRIK and SOLVER Locked

A topic by VadimBernhardt created Mar 12, 2021 Views: 274 Replies: 7
This topic was locked by TwistedTwigleg Mar 22, 2023

Closed due to the bug found in this topic being fixed and due to inactivity.

Viewing posts 1 to 5
(1 edit)

Can I use solvers like Position3D to determine the position of a magnet in FABRIK from code?
Developer (1 edit)

Hey VadimBrenhardt,


I’m not totally sure what you are asking, can you explain further what you are looking to do?

If you are asking to use a Position3d node as the magnet position, this should be doable. You should be able to set the magnet position in code and as long as the position you pass is relative to the Twisted_Skeleton3d, then it should work. I’m currently away from my PC, but if you want/need I can probably make a quick example code snippet.

Hi yes I want to use the Position 3D node for the Magnet Position. And to see the code how to use it would be great. Thanks

Developer

Okay, here's a script that sets the FABRIK 3D magnet position based on the position of a Position3D node. Just apply this script to a Position3D, setup the inspector variables, and reload the scene, then it should work :)

Google Drive link: https://drive.google.com/file/d/1DnFXr8oK8ZUgtn-c4M0kMqHjcP-FGf5M/view?usp=shari...

I'll include the script in a folder called "Utility_Scripts" in the next release of Twisted IK 2 with the development example project as well, so anyone in the future can also benefit from the script.

Cool! thank
(1 edit)
I don't understand, is it fixable?

Developer

I believe what is happening is the Twisted_Skeleton node is out of sync with the Skeleton3D node. The issue only occurs when the skeleton is rotated, correct?

The Twisted_Skeleton3D node needs to rotate as well with the Skeleton3D node, as they must be kept in sync for it to work. If you want to rotate an IK assembly, then you’ll want to rotate a node that is a parent to both the Skeleton3D and the Twisted_Skeleton3D node. I would see if that fixes the issue.

Developer

I found out what the issue is and this problem will be fixed in the next version of Twisted IK 2, version 2.2.0! I am planning to release version 2.2.0 this upcoming weekend, so March 20th to 21st.

The issue was with how FABRIK solved with relative positions and how magnet positions are applied. Thanks for reporting the bug!

Developer locked this topic