• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Bone tool AS Help

New Here ,
Oct 11, 2013 Oct 11, 2013

Copy link to clipboard

Copied

Okay, so I'm trying to use the bone tool for it's IK so I can make a rope for my game. But for some reason it just refuses to work.... like almost at all. Here's a snippet of my code, I really just followed the Adobe sites tutorial here: http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS76E4A0A2-F3D9-43c8-BA07-A2B6D6DE5266.h...

public function init(e:Event):void

        {

            var tree:IKArmature = IKManager.getArmatureByName("Armature_18");

            var bone:IKBone = tree.getBoneByName("ikBoneName74");

            var endEffector:IKJoint = bone.tailJoint;

            var pos:Point = endEffector.position;

           

            ik = new IKMover(endEffector, pos);

            ik.limitByDistance = true;

            ik.distanceLimit = 10000000;

            ik.limitByIteration = true;

            ik.iterationLimit = 100;

           

            this.addEventListener(Event.ENTER_FRAME, ropeUpdate);

        }

       

       

        public function ropeUpdate(e:Event)

        {

          // I have it spawn and attach to the player

            var mat:Matrix = this.transform.matrix;

            var pt = new Point(0, 0);

            pt = mat.transformPoint(pt);

           

            ik.moveTo(pt);

        }

But instead of moving to whatever point I've set for it, it just sits in its default position and wiggles around a little bit when I move. I'm close enough for it to reach the point and it doesn't seem to be trying to reach a different point. So I'm really confused and I need help. Here are some screen shots of what it's doing:

FFTG help 1.pngFFTG help 2.pngFFTG help 3.png

The only time I think it might even be TRYING to reach the point is when I'm already almost on top of it but then it just moves upward when I do for no reason. It even does this when I'm even farther away from the point than when I was on the ground. I have no idea what I'm doing wrong and I'd greatly appreciate some help.

TOPICS
ActionScript

Views

239

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation