Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Obi Rope Wave Effect
#1
Hi,
I am using a water pipe visual in my game. When the player touch the screen, a flow effect should play on pipe. It will not be a continuous flow. Just tapping will advance a single wave from start to finish. Can you help me for this visual ? 

Thanks.

[Image: o53r1h6.png]
Reply
#2
Hi!

You can just use a sine wave along the rope, changing particle radius according to it.

Using the particles API you can read/write principal radii, position, velocity, color, and all other properties for each individual rope particle. See:
http://obi.virtualmethodstudio.com/manua...icles.html

I believe you asked this exact same question a long time ago, I wrote the code that does this for you:
http://obi.virtualmethodstudio.com/forum...ight=bulge
Reply
#3
(12-08-2022, 07:16 AM)josemendez Wrote: Hi!

You can just use a sine wave along the rope, changing particle radius according to it.

Using the particles API you can read/write principal radii, position, velocity, color, and all other properties for each individual rope particle. See:
http://obi.virtualmethodstudio.com/manua...icles.html

I believe you asked this exact same question a long time ago, I wrote the code that does this for you:
http://obi.virtualmethodstudio.com/forum...ight=bulge

But your answer is a continuous flow. Not a single flow from single tap.
Reply
#4
(27-09-2022, 04:35 PM)kureysalp Wrote: But your answer is a continuous flow. Not a single flow from single tap.

Well of course, this is just an example on how to control rope thickness by setting the radius of individual particles. Anything that’s specific to your use case is completely up to you to implement as it’s plain C#, not related to Obi or its API.

If you want a single flow, clamping the sinewave is trivial to do.

If you want something more complex like keeping track of multiple individual “flows” along the rope, you can store these in a list of floats, each float tracking how far along the rope a “flow” is. When you want to create a “flow” (for instance when the user taps the screen) add a new entry to the list. Every frame, add a fixed amount to each value in the list to advance the “flows” down the rope. When a value gets outside the rope, remove it from the list.

Kind regards,
Reply