2 Replies Latest reply on Jun 29, 2006 5:11 AM by AndrewNock

    Creating Linear Dashpots in my scene

    AndrewNock

      Hey all,

      I'm trying to use linear dashpots in my scene using this code

      linearDashpot = hk.makeLinearDashpot ("MyDash", "hkCabin", "hkArm1")
      linearDashpot.strength = 40
      linearDashpot.pointA = vector (0.0, 0, 5)
      linearDashpot.damping = 0.5

      Unfort, when I run it, it comes back saying
      "Script error: Value out of range
      linearDashpot = hk.makeLinearDashpot ("MyDash", "hkCabin", "hkArm1")
      -2147219496"

      Any solutions?
        • 1. Re: Creating Linear Dashpots in my scene
          Level 7
          AndrewNock wrote:

          > Hey all,
          >
          > I'm trying to use linear dashpots in my scene using this code
          >
          > linearDashpot = hk.makeLinearDashpot ("MyDash", "hkCabin", "hkArm1")
          > linearDashpot.strength = 40
          > linearDashpot.pointA = vector (0.0, 0, 5)
          > linearDashpot.damping = 0.5
          >
          > Unfort, when I run it, it comes back saying
          > "Script error: Value out of range
          > linearDashpot = hk.makeLinearDashpot ("MyDash", "hkCabin", "hkArm1")
          > -2147219496"
          >
          > Any solutions?
          >

          Hi. Check if "hkCabin" and "hkArm1" are RBs. Maybe "hkArm1" it�s not a
          RB and Havok expects a worldPoint value as parameter instead of a RB.

          HTH,
          --
          Agust�n Mar�a Rodr�guez

          www.onwine.com.ar > Macromedia Director demos & code
          • 2. Re: Creating Linear Dashpots in my scene
            AndrewNock Level 1
            thanks for that.

            I used the world point value and something works (don't get an error at least)!

            worldPoint = p3Dmember.model("Rope").transform.position
            otherPoint = "ArmToRope"
            dashpot = hk.makeLinearDashpot( "DashpotName", otherPoint, worldPoint )
            dashpot.strength = 10
            dashpot.damping = 0

            What I want is for the rope to be 'attached' to the 'ArmToRope' (simple box at the top of the crane). It keeps detaching itself though....