21-12-2021, 08:11 AM
(This post was last modified: 21-12-2021, 08:12 AM by josemendez.)
(20-12-2021, 08:57 PM)sodach1 Wrote: Hi guys. Can anyone give me an advice on which features to use to attach an object to a rope and move it along, like along a dynamic spline?
I wanted to use Particle Attachment and move the path point assigned in there, but as far as I understood, you can't move path points like this. So the thing is what should I do?
You can use:
Code:
var section = rope.GetComponent<ObiPathSmoother>().GetSectionAt(float mu);
GetSectionAt() takes a normalized coordinate as input (a float from 0 to 1, 0 being the start of the rope and 1 being the end) and returns a struct containing position, normal, tangent and bitangent (a full orthonormal frame) of the rope at that point.
Also see the utility script /Obi/Scripts/RopeAndRod/Utils/ObiRopeAttach.cs for an example of how to use it to place an object along the rope.