Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Automatic Target for jiggle Locked

A topic by nate066 created Jan 09, 2021 Views: 363 Replies: 14
This topic was locked by TwistedTwigleg Feb 27, 2021

Feature added! Thanks for the suggestion!

Viewing posts 1 to 5
(1 edit) (+1)

Right now jiggle expects a target this makes jiggle hard to use because I would like to use it to jiggle hair, a dress, etc... but trying to find the right target location is nearly impossible. This results in distortion and the jiggle not working right. It would be great to have jiggle without a target or some form of automatic computation for the target.

Take a look a blender wiggle bones to see what i mean.

Developer (1 edit) (+1)

Thanks nate066 for the suggestion. I agree that having a different way to set the jiggle target without necessarily using a node would be good. I鈥檒l look at Blender鈥檚 wiggle bones as reference.


I鈥檒l add it to the TODO list for the next version 馃憤

Developer(+1)

Alright, this feature is now implemented and will be part of the next release.

Implementing this helped me see a different bug that I need to fix as well: The velocity of jiggle joints down the chain is being applied too strongly, causing too much jiggle. This is similar to an issue I had on the physics joint, though in this case the solution will need to be different. I've done some testing and am narrowing down on the solution, so hopefully it a fix will not take too long.

Wow, that was fast

Developer

Setting the jiggle target without a node has been added in version 1.2.0, which was just released :D

Gave it a try but unfortunately it doesn't seem to work it prints "Cannot not execute FABRIK: No target found!" I tried to add a target then enable the option to use a vector3 instead but same thing happens.

Developer

hmm, strange. It shouldn鈥檛 be printing FABRIK errors but maybe I copy-pasted the wrong error message or something. I鈥檒l look into it!

the error line that gets printed is on Twisted_ModifierJiggle3D.cs 589 

Developer

Okay, this error should now be fixed in version 1.2.1! It was just a condition that checks for a target node that was causing the issue. I also fixed a bunch of the typos in the error message logs, so now they shouldn't be as confusing (no more double negatives).

I found some other bugs with jiggle, gravity doesn't seem to work properly it seems to have bias of sorts. using jiggle with an animated mesh doesn't work the bone just rotates toward the target, seems like the target need to be computed automatically and updated each frame. The video I posted shows these issues. Thanks for your work on this addon.

Developer

Thanks for the video and debugging help. I'd say I'm surprised that gravity is having issues, but I've had troubles with the gravity implementation in my previous code so I'm not too surprised it's causing issues here. Something about gravity and the algorithm used do not like each other. For the animated mesh, I will need to investigate potential solutions and see what I can do. With both cases, I will add them to my TODO list and will look at them once I can.

Thanks again!

Developer (1 edit)

I just watched the video again in full screen so I could get a better look at what is going on.

With gravity, I *think* the issue is just that the conversion from bone space to world space is messed up, so it thinks gravity is in the wrong direction. This should, hopefully, be relatively easy to solve. I'll try to take a look at it in the coming week or two and see if I can find a fix.


For the animated mesh, this issue is a touch more complicated. The target direction is relative to the root of the skeleton and not the bones themselves, so that's why its pointing in the same direction as the character animates. That said, even if the target rotated with the root bone of the jiggle chain, it wouldn't give the desired result of adding complimentary motion, or at least I do not think it would, as it wouldn't be taking the animation's motion into account when solving the jiggle joints.

I will need to do some testing on this and see if I can find a solution, but this may need to be a separate IK modifier since it will have to solve in different way. I'll see if I can find a 3D model with similar motion for debugging and will see what I can do. This fix may take a bit longer though, unfortunately.

Thanks again for the video! It is quite helpful for seeing what is going on.


Edit: After thinking about it for a bit, the animated mesh issue may just be a matter of rotating the target with the rotation of a bone, just not the origin of the jiggle chain (otherwise it would never rotate) but instead it's parent. If that is the case, then it may be easier to get the correct result. Will need to test to know for sure, but maybe the issue is easier to solve than I thought...

(+1)

here is the file that was used in the video. https://we.tl/t-8DANDLtNzq

Developer(+1)

These issues should be fixed now in version 1.3.0!

Developer

Closing this topic now that automatic jiggle targets are implemented. If you have any issues or other requests, please make a new topic to let me know! Thanks!

Developer locked this topic