I have an aiming animation that's 1 frame for aiming my character that works really well, however when I go to add some basic projectile functionality in Godot, neither SpineSlotNode or SpineBoneNode seem to follow the aiming and I'm guessing it's because it's not an actual "animation" since it's only one frame so it's only following the initial 1 frame position and not being updated by the IK, is there any clean way to solve this or am I being silly and missing something?
SpineSlotNode and SpineBoneNode not following IK aiming animation
- Modifié
Alyria I'm not quite sure what's wrong with the mp4 you attached, as it looks like the character's body is moving correctly to follow the mouse pointer. Is the expected behavior for the Godot icon shown in this video to follow the position of the mouse pointer? Could you please tell us more about what the expected behavior is?
Could you also show us a screenshot of the scene dock? If the parent-child order of the nodes in the scene dock is wrong, the SpineSlotNode
or SpineBoneNode
may not follow the target correctly.
oh yea sorry I probably should have mentioned that, you're right the godot icons are there to indicate that the positions of the slot/bone nodes aren't being updated and moving along with the character aiming (which is working really well). I have both nodes as children of the spinesprite node, and the icons are children of the slot and bone node as instructed in documentation, with the bone node being set to follow.
Alyria I see, thank you for your clarification! I tried to reproduce the same configuration using the example project but could not reproduce your problem:
Could you please send us via email a minimal project that can reproduce the problem?: contact@esotericsoftware.com
oh yea that's weird I tried it out on the mouse follow example too and it works fine, maybe it has something to do with my spine rig instead? I'm not sure what code would be conflicting with the spineslotnode logic to have it not work but I can send both.
If you've keyed the bone the IK should drive, the key may overwrite the IK. Make sure the IK driven bone is not keyed (in the Spine Editor).
Alyria Thank you for sending us your Spine and Godot project files! It seems that Mario had exactly the right idea about the cause. It works fine when I remove the translate key on the target-Aim
bone in the Front/Front-Aiming-2H-Range
animation:
Please confirm on your end that removing the translate keys from this bone has solved the problem.
oh wait yea I'm dumb I thought he was referring to the weapon bones that I'm putting the slot/bone nodes onto, but rereading it "IK Driven bone" would be referring to the aim IK bone. I thought since the overall animation was working that it wouldn't matter if the IK driven bone had some extra keys since it still seems to work fine in godot for aiming the body visually but this makes a lot sense. Just deleted the extra keys from spine and yeah it works perfectly, including the shooting which I was actually kinda expecting not to work and I would have to change my code on. Thanks for helping me so quickly and sorry for the slow responses, I've been kinda distracted the last 2 nights.
Alyria Great to hear that it works perfectly now!
In fact, I think it was hard to know which key to remove. For your information, what I tried first was to create a very simple animation instead of removing each key to see if it would work. Then it worked, so I thought it must be a problem on the animation side, so I checked it and found that the translation key was the cause of the problem. If you encounter something that doesn't work in the future, try it once in a very simple state
for sure, I thought it might be a problem on the animation side of things since it worked fine on the spine examples, I just never would have thought to check the aim IK since visually it seemed to work well but little did I know I guess the logic working under it needed for the slot/bone nodes to work mechanically needed to have that key freed.