Obi Official Forum

Full Version: How to fallow rope
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When i press play i want my charachter follow the rope start to end. How can i follow with code ?

Do i need to get particle positions ? if so how can i reach particle positions from code ? or are there any alternative way ?
Simplest way to get a position/orientation along a rope is to use:

Code:
var frame = rope.GetComponent<ObiPathSmoother>().GetSectionAt(value);

You pass a normalized length value as parameter (0 for the start of the rope, 1 for the end, or any value in between) and you get a ObiPathFrame struct that contains position, orientation, color, thickness, and an orthonormal frame (normal, binormal, tangent) at that particular point in the rope.

There's a utility script included that you can try: "ObiRopeAttach". It uses this method to just move an object to a point along the rope.

You can also use raw particle positions if you want, see:
http://obi.virtualmethodstudio.com/tutor...icles.html