Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Animation on IK target doesn't activate entire IK chain correctly

A topic by aros2 created 90 days ago Views: 82 Replies: 3
Viewing posts 1 to 9

I'm on Godot 3.5 using the latest version of Twisted.  I'm trying to set up a basic animation that moves the IK target sprite on the built in demos (e.g. 2D_Test_Scene_6.tscn) . Even though moving the target in editor mode bends the arm of the character correctly, if I move the target's position in either AnimationPlayer or a gdscript, when I run the game and it plays the animation, the target moves and so does the endpoint, but the limbs are not bending correctly.

Is there something extra I need to do to activate the entire IK chain each frame? 

I attempted advancing AnimationPlayer manually, leaving a few  frames for Twisted to 'catch up'... the result was the arm moves a lot slower, but the limb angles still 'snap' instead of slowly tweening. It makes no sense at all. It's like the Twisted IK solver just isn't running properly.

(+1)

I SOLVED IT!

The problem was AUTO CALCULATE BONE LENGTH and BONE ANGLE. Once I turned that off and manually set the lengths of the bones it works!

Developer

Hi aros2,
Apologies for the delay in replying, and great work solving the issue! I'm not totally sure why the auto-calculate code was causing the issue (maybe it was setting the bone length to zero? Maybe something since I wrote it changed how the calculation works?) but I'm glad that you were able to solve it! And thank you for sharing the solution here so others can benefit from it as well in case they also run into the issue.

Thanks again,
TwistedTwigleg