Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

ModifierLookAt3D causing bone to infinitely scale Locked

A topic by iwilliams created Sep 09, 2021 Views: 209 Replies: 5
This topic was locked by TwistedTwigleg Mar 22, 2023

Closed due to inactivity.

Viewing posts 1 to 5

I noticed the ModifierLookAt3D with additional rotation set was causing my bones to scale out of control after a bit of time. Added the following to line 155 of res://addons/TwistedIK2/IK_3D/Twisted_ModifierLookAt3D.cs:

 twisted_bone.Transform = new Transform(twisted_bone.Transform.basis.Orthonormalized(), twisted_bone.Transform.origin);
Developer(+1)

Hey iwilliams!

Thanks for letting me know about this and providing a code snippet that fixes the issue! I really appreciate it! I will take a look at the issue this weekend and see if I can figure out what is causing the issue and release a fix.

Developer(+1)

I just released version 2.6.0, which should fix the issue, as well as fix a few other issues.

I also applied the fix to the other IK solvers, as they were likely to experience the same issue and the fix also made things a little simpler, so a win-win all around. Thanks again for reporting and if you have any other issues (or version 2.6.0 didn't fix it for you), please do not hesitate to let me know!

(1 edit) (+1)

Thanks! I'll give the new version a shot sometime soon. I'm currently integrating Twisted IK into a prototype I'm working on so I'll let you know if I find anything else as I go. It's really been great so far, coming from the inconsistencies in Godot's vanilla IK across the last few updates.

The only other thing I've tweaked is adding a `use_target_up` option to the look at modifier. I have a first person arm rig parented to my camera and the hard coded up direction was making my bones twist around when I put my hands in the air. Here's the snippet:

Vector3 up_dir = Vector3.Up;
if (use_target_up) {     up_dir = target_node.GlobalTransform.basis.y; } twisted_bone.LookAt(target_node.GlobalTransform.origin, up_dir);
Developer

Awesome! If you find any issues or have any suggestions, please do not hesitate to let me know!

For the bones twisting, the latest update might fix this as well, as now it uses the bone's initial/resting forward position, rather than a hard-coded Vector3.UP. That said, I'm not totally sure that will fix it. I'll try to see if I can get a test rig hooked up and will test it. If it doesn't fix the issue, I certainly don't mind adding a "use_target_up" option if it would help.

Thanks again!

Developer

Closing this as it's been almost a year since the last reply. Please feel free to make another post if this is still an issue. Thanks!

Developer locked this topic