Using this very simple code with a physics handle, i’m trying to position an object so that it is always in the same world position relative to the bone’s world position:
The object actually moves to the correct location more or less at the start, however when I move the character around it’s like the object will go in the opposite direction first before correcting itself back into place.
How can I make it actually stay fixed in the correct position when the character moves?
Note: I tried not using a physics handle and just using set world position, it had the exact same issue, so this is not a physics handle problem. When I used set world position the problem was actually a lot worse, as if I used another character to collide with this one the object would be massively and permanently displaced, and constantly trying (and failing) to get to the correct position, even if ‘teleport’ is switched on; I also tried removing the up vector bit and just plugging the bone location directly in, it had no impact on the issue.
I have figured out why. for some reason the X and Z axis are always set relative to the root bone instead of the bone whose position is requested. And the root bone is following the rotation of the pelvis. which is why the object always goes in the opposite direction. I pull the model in (because that’s the direction the pelvis rotates towards and the root bone follows that rotation)
Still working on how to actually solve this. Is there a way to fix this behavior?
This is making the entire ‘bone/socket’ location system unreliable for me.
Ok, so the problem was that I was forcefully setting the mesh rotation on event tick to make the semi-ragdoll character stand.
When this is done, apparently the ‘root bone’ is immediately rotated and placed where it would end up while the rest of the body slowly adjusts itself to the position the root bone expects it to be in.
I resolved this by using a physicshandle to make the character stand instead of setting the world rotation for it.
I feel like this is still a major flaw in the get socket location and rotation nodes, because when you request the location of a socket, you are requesting it’s current location not where it wants to be. But apparently the node will only give you where the socket wants to be instead of where it actually is, leading to this cornercase issue.