Obi Official Forum
Help Make the rope float - 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 Make the rope float (/thread-3622.html)



Make the rope float - Slava - 24-10-2022

Hi
I'm using your rope as a fishing line. I need the rope to float on the water.
The water asset uses a rigid body to make objects float.
If you have an idea to help, I will be grateful.

I have an idea how this can be done.To do this, I must get the location of particles in world space. And then check if they are in the water, then move them in the right direction or use force on them. Is it possible to do that? If yes, then how?

I am using KWS Water System.
https://assetstore.unity.com/packages/tools/particles-effects/kws-water-system-hdrp-rendering-205007


RE: Make the rope float - josemendez - 24-10-2022

(24-10-2022, 12:14 AM)Slava Wrote: I have an idea how this can be done.To do this, I must get the location of particles in world space. And then check if they are in the water, then move them in the right direction or use force on them. Is it possible to do that? If yes, then how?

Hi,

Yes, that's the right approach. You can get/set any per-particle property using the particles API:
http://obi.virtualmethodstudio.com/manual/6.3/scriptingparticles.html

If you want  to apply forces to particles, write into the solver's externalForces array. If you want to apply accelerations, use the solver's velocities array instead. Note all properties are expressed in the solver's local space, you will need to convert to/from world space using the methods defined in Unity's transform class.

kind regards,