Obi Official Forum
Help How to create a tinsel? - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Help How to create a tinsel? (/thread-3394.html)



How to create a tinsel? - niuage - 06-04-2022

Hi,

I'm probably missing something obvious, but just reading the doc, I can't figure out how to make something similar to a tinsel.

Right now I have a rope attached to 2 points, so far so good, but how can I attach objects to the rope such as they follow it without influencing it, or very little?

Thanks for any pointers.


[Image: JePHV2g.png]


RE: How to create a tinsel? - josemendez - 06-04-2022

(06-04-2022, 02:03 PM)niuage Wrote: Hi,

I'm probably missing something obvious, but just reading the doc, I can't figure out how to make something similar to a tinsel.

Right now I have a rope attached to 2 points, so far so good, but how can I attach objects to the rope such as they follow it without influencing it, or very little?

Thanks for any pointers.


[Image: JePHV2g.png]

Hi,

Just use the GetSectionAt(float normalizedCoord) function of ObiPathSmoother. This will give you a full orthonormal frame at any point along the rope, that you can use to place an arbitrary object at.

The normalizedCoord you pass to GetSectionAt() is 0 at the start of the rope and 1 at its end (0.5 would be the middle, etc).

See for the utility script ObiRopeAttach ( found at Obi/Scripts/RopeAndRod/Utils/ObiRopeAttach.cs) for a simple example. This is a script you can place at any object and it will locate it at the given position/orientation along the rope.

Note that using GameObjects for each individual "flag" won't scale past a few dozens of them, so if you plan on having many of these I'd recommend using other (possibly shader-based) approaches.


RE: How to create a tinsel? - niuage - 06-04-2022

Well, that's an impressive response speed to say the least Gran sonrisa

I'll get on that, thanks.