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


Messages In This Thread
How to create a tinsel? - by niuage - 06-04-2022, 02:03 PM
RE: How to create a tinsel? - by josemendez - 06-04-2022, 02:09 PM
RE: How to create a tinsel? - by niuage - 06-04-2022, 02:11 PM