[PLUGIN] IK Solver 2

This forum is currently in read-only mode.
  • IK Solver 2

    :

    Version: 2.0.1

    Creator: Chris Hackmann(AKA, linkman2004)

    License: Freeware

    IK Solver 2

    Download Now(with example) - 113KB

    NOTE: I suggest reading the below description/documentation before use. There is also an example at the bottom.

    What's IK? - IK is a method for making a chain of bones bend in the correct way to reach a specific point.

    What does this plugin do? - This is a plugin that takes all of the fancy math out of solving 2-bone IK chains. It automatically rotates the bones to the correct angle to reach a specified control point. It also positions the second bone automatically to the end of the first.

    How does it work? - Very simply. The plugin consists of only one action: Solve IK. This action takes a few parameters:

    - Bone 1: This is the first bone in the chain.

    - Bone 2: This is the second bone in the chain. It will be positioned to the end of the first bone.

    - Relative distance: This is the relative distance from the end of the first bone where the second bone will be positioned. For example, a value of -5 would place it 5 pixels from the end of the first bone, while 5 will place it 5 pixels past the end of the first bone.

    - Control Point: This object represents the point that the IK-chain is attempting to reach.

    - Direction: This is the direction of the bend of the bones. With outward, the bend will point towards the right when the control point is below the first bone, while outward will point towards the left in the same circumstance(see the example for a better explanation).

    This action must be called every frame. The objects picked are the same as object picking everywhere else.

    Example(s)

    IK Solver 2 - Example File

    And that's about it. Be sure to leave your comments/questions. I'm calling this done for now, but if there's anything you want to see, let me know!

    NOTE: I HIGHLY recommend upgrading to this version if you are already using the original. It fixes two major flaws with the original. The actions will have to be swapped out by hand due to incompatibility between the two versions.

  • Nice plugin

    I know this is offtopic, but could you fix this problem with your HUE plugin before releasing it?

    Basically if you try to use it in a family, and you select the "set hue" action, you can't set the hue.

  • Thanks, man.

    I know this is offtopic, but could you fix this problem with your HUE plugin before releasing it?

    Basically if you try to use it in a family, and you select the "set hue" action, you can't set the hue.

    I'm willing to bet that's a problem in Construct. I'd check using another effect to make sure, then submit a bug report if it has the same problem.

  • linkman2004

    I think I found what was causing that bug with the bones disappearing. It seems if you resize one of the bones and then pull the control point over where they connect, they disappear.

  • Damn, I thought I had fixed that. It appears to be a division by zero error, so It should be pretty easy to fix.

    Thanks for the heads up.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I've got a fixed version of this plugin up now:

    IK Solver 2

    Download Now(with example) - 113KB

    Adds/Changes/Fixes:

    [FIX] - Having the control point at the position of the first bone would make all of the bones disappear due to a division by zero error.

  • Cool, thanks again lman.

  • I have something else im not sure about. If you would take a look at the cap, and notice the gap between bones when you jump. The question is, is that supposed to happen, because of how I'm handling the control point, or is there something else going on?

    http://dl.dropbox.com/u/666516/iksolvercustomovement.cap

    Thanks.

    Edit:

    It seems to happen on both axis's , even when I set the relative distance closer to each other.

  • This is because you have the "Solve IK" action before you position the first leg object. Since the second bone is positioned to the current position of the first bone, a gap will occur if the first bone is positioned after the IK action. Just place said action after the action where you set the position of the first bone and it works fine.

  • Ahh, got it thanks!

  • Any idea if this still works correctly in latest builds?

    Don't want to waste time messing around with something to find out 6 hours later it doesn't work for some reason... cheers!

    ~Sol

  • Any idea if this still works correctly in latest builds?

    It still works without a hitch.

  • Not to bump, but I think you should be able to add animations, like the bone tool. When I drag something on the bone to, to make a part bend, it snaps. =/

  • Not to bump, but I think you should be able to add animations, like the bone tool. When I drag something on the bone to, to make a part bend, it snaps. =/

    The only purpose this plugin has is to make simple, realtime IK chains, so animations aren't something I'll be adding. And what do you mean by snapping? I'll take a look if you can provide me with a CAP file.

  • I should say coming apart. You push down the torso, the legs are suppose to bend, like in 3ds max or most graphics programs such as Adobe Flash. However, I push down on the torso, it comes off.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)