No announcement yet.

How to correctly implement physics constraints at runtime

  • Filter
  • Time
  • Show
Clear All
new posts

    How to correctly implement physics constraints at runtime

    I'm attempting to set up a rope connection between two components with a constraint. I had downloaded the grappling hook plugin which was a good intro, but it does not account for moving targets, and instead uses fixed locations to lerp between.
    1. I created a component called debugHookActor, and within that is a constraint component with a child mesh. This is the actor I attach to an actor upon hit, at the location of impact. The constraint here is set to X-free and Y-free with Z locked (I later set the unit constraint)
    2. In the player character ThirdPersonCharacter, I have a constraint at the pelvis.
    3. Next, I add a cable and connect it to the to the pelvis constraint.
    4. Next, I connect the other end of the cable to the debugHookActor constraint.
    5. Next I take the debugHookActor constraint, and set the components to the player mesh component, and the debugHookActor>constraint>mesh.

    The cable connects perfectly between the two points, but I cannot seem to enforce the constraint distance between the two components. When I jump off a edge, I expect to swing, but I fall more than 1000 units.

    I've attempted simulating physics but this only removes the ability for the player to move the same way.

    I've attached my blueprint images for context. Can anyone tell me where I am going wrong?
    Attached Files

    Bump? Does anyone have any suggestions for this?