Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to fallow rope
#1
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 ?
Reply
#2
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
Reply