#Help. Enemy entities are doing the harlem shake when I instantiate several of them because of IKs!!!

28 messages · Page 1 of 1 (latest)

minor hornet
#

(I've deved several games in my life but im new-ish to godot and the tools im using in it so i've put a beginner tag)

The setup

Hey gang!

So i've been trying to do some animation and animates bone and all that cool stuff. In order to do so I did the following:

  • Made sprites for stickman limbs and stuff
  • Organized it in a bone architectures with bone and sprite nodes (you can see the whole architecture in one of the screens)
  • Made a modification stack and made a CCDIK modification stack for each limb
  • I also made a look at modification for the head which I disabled!

The issue and my attempts to fix it

Very cool, my stickman reacts to the IK targets, it's easy to animate, i'm an happy dev. I keep working and then wanna see their proportion compared to my castle. I realize lots of errors (which apparently are normal and will be fixed in godot 4.3, link about it here: https://github.com/godotengine/godot/issues/73247)
But to be sure I drag and drop a few of them in my main gameplay scene and launch the game and BEHOLD. They harlem shake and they seem, from observation, that they try to target ALL the IKs at once. At least if you take a close look to the non moving one, all his limbs rotate towards IK targets of another stickman. But it ain't his local ones!
So I totally understand that the problem is that they confuse their IKs, but I truly don't know how to fix that even though I tried!

  • I tried to make the skeleton2D modification stack and each of its modification a unique ressource... It didn't work!
  • I tried to make the path to my IK targets unique with the make unique option, didn't work! (I didn't do any other step than right clicking the node and selecting the "make unique option"

I could completely just disable their IKs and activate them one by one for my game. But if I ever want to just have enemies in a later game that have their feet reacting to ground level for stairs for instance. More screens bellow!

GitHub

Godot Engine – Multi-platform 2D and 3D game engine - Issues · godotengine/godot

minor hornet
#

I'll do a little rebump hoping it's not something that is regarded as a bad thing to do, a bad etiquette. But I think it'll be the last time I do so. I might be alone in this fight.

muted hatch
#

Maybe this is related: "Note

IK chains in Godot currently work in the editor only, not at runtime. They are intended to ease the process of setting keyframes, and are not currently useful for techniques like procedural animation."

minor hornet
#

Haha thank you for that but this is obsolete information! As you can see this page is not up to date with godot 4.2 and there are tutorials online showing how IK animation is working like this one
https://youtu.be/G_seJ2Yg1GA?si=lMjcTWkIf-5f9aSa

With the removal of the SkeletonModification stack my old procedural animation video was outdated. I decided to do a new and improved implementation with what's currently available in Godot 4.0

Resources:
* Spider Bot Model - https://drive.google.com/file/d/1j0qbkJf8iuz6682UUzhV1Y5RgjSXIdUS/view?usp=sharing
* Github Project - https://gi...

▶ Play video
muted hatch
#

Is the video author using IK or IK chains?

minor hornet
#

They are using skeleton modification, its a new feature introduce in Godot 4.0 that allows to have IKs to animate and to do procedural animations with something called "modification stacks"

You can check these out in the documentation here:
https://docs.godotengine.org/en/stable/classes/class_skeletonmodification2d.html#class-skeletonmodification2d

Inherit by explains every type of skeleton modifications

#

As far as I know, IK chains do not exist in godot 4 no more, at least, no in the way the cutout animation documentation page provides

muted hatch
#

I'm not an expert in IK, the way it looks from me from a first glance is that perhaps "IK chain" is referring to node nesting. The video author does not appear to be nesting his IK targets. I don't know if that's the problem, but it might be worth looking into.

minor hornet
#

yes I don't know. Maybe I just need to instantiate IK targets with a unique name when needed and deinstantiate them when I dont need to no more. Or like do it in code. But y I find it weird that it just doesn't work right away

muted hatch
#

I don't know what I notice is particular is this

minor hornet
#

I could get rid of the endbone though

#

It even says it here

#

Ill try getting rid of my endbones. They were here just to make my previous bone the correct length, but they are very obsolete now

#

Thank you for pointing it out

muted hatch
minor hornet
#

Well this is related to godot 3.X because make Ik chain is not an option that is available anymore in godot 4.2

#

As they say in the issue, now it uses skeleton modification and make ik chains is an obsolete concept

muted hatch
#

I see maybe it's something else then

#

I also found some 4.x bugs related to 2d kinematics when I did a search in gitbhub issues https://github.com/godotengine/godot/issues/73168 https://github.com/godotengine/godot/issues/75224

GitHub

Godot version v4.0.rc1.official System information Windows 10, GeForce RTX 3070 (Driver version 528.49), forward_plus rendering method Issue description When adding a SkeletonModification2DCCDIK mo...

GitHub

Godot version 4.0.1 Mono System information Windows 10 Issue description When a Node2D has its scale set to -1 on the X axis to flip the rig, IK no longer correctly paths to its targets. This happe...

minor hornet
#

I dont seem to have that issue, maybe its been fixed?

#

thank you for all the searches you do on my behalf btw

#

its very appreciated

minor hornet
#

@hot smelt

#

Hope you dont mind the tag but ive tried a few things and explained the problem as well here, if we use it as an hub for the issue we might get more attention/answers?

hot smelt
#

thanks