Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Going down along a rope
#5
(11-12-2019, 04:05 PM)Pingosso Wrote: Thanks Dan for your response. I see you could use pin constraints in the solver but I don't know how it works, the only examples I've seen, were with previous ObiRope version and I don't know how to deal with pin constraints with the 5.0 version. I will check.

Nevertheless, if you put an active rigibody, your player will fall down with gravity and you can't control his descent, no?

I saw another probem with my rope, it's that when the branch where the rope is attached has a pitch angle, so the rope has an angle and follow this angle when it touches the ground, how can i fixed it?

Thanks again a lot


Hi there!

Just chiming in (thanks DissidentDan for contributing! Sonrisa).

Implementing rope climbing depends on a lot of things, and can be done in multitude of ways (none of them trivial, btw). So it is a really broad and complex question.

- How your character movement is implemented? Does it use a rigidbody, controlled by forces/impulses, or is it semi-static? (moved by altering its transform directly).
- Do you want two-way coupling (the rope reacts to the character applying forces to it, and the character reacts to forces applied to the rope) or is it enough for the character to "follow" the rope without affecting it?
- How should the character attach to the rope? Should it grab it automatically based on distance, grab it based on user input, maybe a combination of both?
- Can the character climb up and down an existing rope, or is the rope "emitted" by the character (kinda like a grappling hook)?

The approach used to implement climbing differs greatly depending on the answer to these questions. Suppose that your character uses rigidbodies, that you want two-way coupling, and that the rope is pre-existing. In that case, you can use pin constraints (4.X) or dynamic attachments (5.X). You'd need to update the attachment dynamically every time the character moves up or down the rope.

If your character is not using a rigid body and you don't need two-way coupling, things get simpler. You can simply use rope.GetElementAt() to retrieve the structural element (ie, constraint) at any point in the rope -given as a normalized value in the (0,1) range-, and then set the character position to a point along that element.

In the third case that the rope is "emitted" by the character (like a grappling hook) Obi already includes a sample scene implementing this (aptly named "RopeGrapplingHook" Sonrisa)

Anyway, it's a difficult question to answer as it depends on a lot of details about how your character works and how to want the final behavior to be.
Reply


Messages In This Thread
Going down along a rope - by Pingosso - 10-12-2019, 03:31 PM
RE: Going down along a rope - by Dissident Dan - 11-12-2019, 03:50 PM
RE: Going down along a rope - by Pingosso - 11-12-2019, 04:05 PM
RE: Going down along a rope - by Dissident Dan - 11-12-2019, 07:47 PM
RE: Going down along a rope - by josemendez - 12-12-2019, 09:19 AM
RE: Going down along a rope - by Pingosso - 17-12-2019, 05:15 PM