Skip to main content

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

TwistedTwigleg

229
Posts
9
Topics
312
Followers
14
Following
A member registered Oct 03, 2016 · View creator page →

Creator of

Recent community posts

Correct. If Godot 4 doesn’t support C# in the web, this plugin won’t work because it relies on C# to run.

Great! I’m glad that worked and am happy to help 🙂

Hmm.. maybe try clear_bones and https://docs.godotengine.org/en/stable/classes/class_polygon2d.html#class-polygon2d-method-add-bone? (I can’t add another link for some reason…)

That would be strange if that fixed it though, as I suspect it just sets the bone weight under the hood. The only thing I can think of that might fix it in this case would be setting the node again via the node path might bind it to the TwistedIK2 bone rather than the Bone2D node.

(1 edit)

Also, I don’t think you set the bone weight on the Bone2D itself but instead set it on the polygon2d. The Bone2D class doesn’t have a bones property, but the Polygon2D class does and I think modifying it should fix it.

Unless you are already doing that, in which case please disregard this!

Maybe try the set function? I suspect trying to set the property from GDScript could be causing the issue, so maybe doing something like set(“bones”, bone_array) instead of directly modifying the property would fix it since then it would go through Godot’s object setter system. I know that’s how you can set C# properties via GDScript so I’m hoping that will work here too.

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

Hi d-eisenga

I just downloaded Godot 4.1.1 and opened the Godot 4 project and it seems to be working for me. I downloaded the Godot 4.0 (free) version of Twisted IK 2 from the Itch.io page, downloaded the Godot 4 example project, copied the Godot 4.0 Twisted IK 2 plugin into the project, built it, enabled the plugin, and then opened Scene 2 and the CCDIK worked as expected.

Did you open the CCDIK scene (3D scene 2) before you enabled the Twisted IK 2 plugin? That might have erased the data that was associated with the node and that could have caused it not to work. If you can, can you try downloading the example project again, copying the plugin to the example project, building and enabling the plugin, and then opening the scene and see if that works?

Thanks!

Hi d-eisenga

Thanks for making this topic to let me know of this issue. My guess is something with Godot changed the scene format enough that the setup was lost.

Just to make sure: you are running the development example project for Godot 4, correct? There is also a non-Godot 4 version, which is for Godot 3.X.

I’ll try to take a look once I can regardless.

Thanks again!

(1 edit)

I'm not sure what would cause this, but my guess is that something was being set incorrectly or somehow got reset. Which IK solver are you using? It is 3D or 2D?

I know at one point I was getting all sorts of issues with the FABRIK solver sometimes resetting the bone data on itself in the editor, which I don't remember how I fixed or what was causing it, but it might be something like that going on here.

Also: Technically no, a tip bone is not necessary but it will make the results easier to calculate, which in turn tend to make IK look better.

Thanks for reporting this issue! Version 2.8.0 adds a new option to allow setting which of the basis directions is being used, which will allow you to fix this issue 🙂

(Aside: awesome mech-bird! Looks cool)

Thanks for letting me know about this! Version 2.8.0, which was just released, fixes this issue. 🙂

(1 edit)

The biggest issue is it makes applying any sort of transform onto the bones a bit more difficult, as the positions are mirrored but can be mirrored on only one axis if there is a non fully negative scale (like (-1, 1) for example). I remember when I was doing some OpenGL stuff that matrix math for negatives had some quirks with skinning for animated characters, but it’s been a long time since I’ve done OpenGL work directly and admittedly I never got too far into OpenGL 😅


Thankfully any complexities like that are generally handled by the game engine anyway. The only time I’ve had a bunch of issues with it in modern game engines is directly modifying negatively scaled children transforms (like bones) and doing calculations with non-negative stuff. I’ve also had some physics quirks in 2D a couple times with negative scales but I think that was more due to the non-fully negative aspect (flipping stuff by changing the sign on the X axis) rather than it just being negative.


Edit: I should add that if you are not having issues currently with any negatively scaled stuff, then you’re probably good to go. If there are issues, I’ve found they surface pretty quickly generally.

(1 edit)

Ah, neat! I appreciate you letting me know and I can pull it into the project and release it as a bug fix (with proper credits to you for finding the fix 🙂)

Edit: was going to try and get it over the weekend, but other things came up and I didn’t have time. Will try to add it in this upcoming weekend. Sorry for the delay.

My guess is that changing the scale flips the axis (or axes if multiple), causing it to be mirrored for the bones, their positions, and rotations, but it does not mirror/flip the target position, causing the issue. That would be my guess. I’m not sure why CCDIK would work, but my guess is that it’s because CCDIK is an iterative solver and it only keeps the angle to get bone in account.


That said though, negative scaled skeletons and bones can be tricky even without IK. Unless your project needs negatively scaled skeletons, I would highly recommend keeping the skeleton at a positive scale to prevent the issue.

Posting once just to bump this. I closed a bunch of topics due to inactivity but this one should still stay on the top, but the only way to do that is to post... Apologizes for the useless post.

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!

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!

(1 edit)

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!

I just checked and confirmed you are correct. When I went to zip the files for release, I accidentally copied the Godot 3.X files instead of the Godot 4.X files.
The plugin will still incorrectly indicate the version, but the files should be correct now.

I will add a note on the announcement stating the wrong versions were accidentally uploaded (with proper credits and link to this thread).

Thanks again!

Ah okay, maybe I uploaded the wrong version. Thank you for letting me know, I’ll take a look

Where are you seeing the version 2.4.0? That version is rather old and definitely does not work with Godot 4.0.

Is that based on the plugin configuration file? If so, the following plugin config file is probably out of date, as it’s likely I forgot to update it. If it runs in Godot 4.0 in any capacity without needing the project converter though, it is version 2.7.0 as that is (currently) the only version with Godot 4.0 support.

Godot 4.0 support is added! See the update here: https://twistedtwigleg.itch.io/twistedik2/devlog/504867/version-270-godot-4-supp...

Hey everyone

This is just a quick general announcement/post that Godot 4.0 support is coming and underway now that Godot 4.0 stable has been released. I have gotten the majority of the code ported to Godot 4.0 with .Net standard, however some of the IK solvers are not working. For 2D, this is mostly the physics bones having issues, but for 3D, there is quite a few solvers having issues that were previously working.

I am hoping to have an update with Godot 4.0 support out soon, but I cannot give a timeline at this moment. It is coming though to allow powerful IK in Godot 4.0. Thank you for your patience!

I would recommend checking out the C# basics page on the Godot documentation if you are new to C#, just to make sure you have everything setup and can compile a basic script in a C# Godot project. I would disable the plugin while you are doing this, as otherwise it will not compile

Then after you have the C# Godot project compiled correctly, I would then try enabling the plugin and see if that fixes the issue 🙂

(2 edits)

Have you tried deleting the C# project and solution, adding a C# script (can just be the default Godot-generated one), building the project, and then enabling it again? That is what I would try doing if you have not already, as the plugin was last updated for a version of Godot that was a few releases ago, so its C# generated files probably are out of date and need to be regenerated.

If that does not work, please let me know. If you could also include your OS (Windows, Mac, Linux), Godot version, and possibly the log file, that would be great as it would help me narrow down what the issue is.

Thanks!

The GitHub repository has a Godot module that you need to compile Godot 3 with in order to run. The Wiki on the repo has a step-by-step guide on what steps are needed to get the module working and integrated into a Godot project.

I also precompiled builds for a developer on this GitHub issue, so if you are on Windows you can download and use those builds.

Hello! I made the Godot module and you have my full permission to use it for the jam or for whatever purposes you need. I forgot to upload a license, but will do so soon and will set the license to the MIT license 👍

Sorry about not seeing this sooner! I’m not on Discord and only stumbled across this just now.

I tried using Godot 3.3.4 Mono stable on my Windows 10 development machine and it works there. I did initially have the issue where it said it couldn't enable the plugin, but I hit "build" and after the build I was able to enable it and it worked after that. I think on Windows I only have the "dotnet CLI", so that might be why I wasn't able to reproduce the issue locally.

ARCarr - Thanks for the detailed information! This will be quite helpful for trying to figure out what is going on. I'm wondering if it's a Window specific issue, though I'm still not sure why it is occurring, as I haven't been able to reproduce it on my machine. I will need to test again though, maybe something in a recent Godot version changed something.

For issue 6393: have you tried closing and reopening the Godot editor? If you have multiple instances of the Godot editor open, closing all of them and then reopening the scene may help. I believe it is related to trying to save the ".tscn" file.

(1 edit)

looking online, it may be a naming issue that is causing the problem, if this issue on GitHub is what is causing the issue here too.


Edit: Switching to Mono may also help fix the issue according to this Stackoverflow post. Based on what I can find online, it seems the issue associated with the errors is more on the C# end with project names and stuff than code, but I am not sure what is triggering the issue in this case.

Are you getting the exact same error messages showing something like “Cannot instance script because the project assembly is not loaded”?

Sorry for the delay, it's been a busy several days and I didn't get any notifications there was replies, so I completely missed these posts until now!

Have you used any C# scripts in your project, without necessarily Twisted IK 2 enabled? It seems like it might be something with compiling C# scripts that is causing the issue, at least I think that may be the issue. Can you make a new project, add a C# script, and then see if it builds and runs successfully? The script doesn't need to have anything in it, I don't think, but it may help narrow down if the C# build process itself is causing the issue or if it's something else.

Also, are all the issues mentioning "Cannot instance script because the project assembly is not loaded"? Does the top issue mention anything else, as it could be that one of the issues is causing all the others.

Sorry again for the delay in reply and for the incontinence!

(1 edit)

Okay, I think I know what the issue is and how to fix it.

The issue is the included ".sln" and ".csproj" files in the development example and showcase project. If you delete these files and then hit the "Build" button in the top right corner, it should successfully rebuild the project. I didn't have the correct C# libraries installed on my Windows machine that I was using for testing, but once I got everything installed and hit the "Build" button, the project compiled successfully and then I was able to enable the plugins.

I would try deleting and regenerating the ".sln" and "csproj" files and see if that fixes it. If not, can you see if the terminal/console shows any output and if it does, paste it here or take a screenshot and post that? That way I can look into what is specifically causing the issue and see if I can find a solution!