Obi Official Forum
Obi Particle Trigger - 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: Obi Particle Trigger (/thread-298.html)



Obi Particle Trigger - Riscii - 15-01-2018

Hello,

I just recently purchased obi rope and I have to say, it simulates beautifully. However I was wondering if an Obi Particle Trigger is possible. I want particles that are inside of the trigger to have different properties. For example I have a body of water and when a particle enters the body of water I want the drag to increase and the gravity to change.

I noticed the ObiSphericalForceZone, and this was a possible solution for the effect I wanted to achieve, however when the rope entered the sphere it was thrown out of the water, and placing many spheres under the water wasn't desirable.

For now I just created an obi collider with high friction under the water. It looks okay, and it stops the rope from sinking


RE: Obi Particle Trigger - josemendez - 15-01-2018

(15-01-2018, 06:50 PM)Riscii Wrote: Hello,

I just recently purchased obi rope and I have to say, it simulates beautifully. However I was wondering if an Obi Particle Trigger is possible. I want particles that are inside of the trigger to have different properties. For example I have a body of water and when a particle enters the body of water I want the drag to increase and the gravity to change.

I noticed the ObiSphericalForceZone, and this was a possible solution for the effect I wanted to achieve, however when the rope entered the sphere it was thrown out of the water, and placing many spheres under the water wasn't desirable.

For now I just created an obi collider with high friction under the water. It looks okay, and it stops the rope from sinking

Hi!

You can use regular triggers and callbacks to do what you're looking for.

Create a trigger collider (as you'd normally do in Unity), then create a custom script and register to the solver.OnCollision event. You'll get a list of all particle contacts every frame, including those against triggers. Then you can do anything you like with these particles. Note that changing the gravity per-particle is not possible, but you can calculate and apply a buoyancy force to your particles that counteracts gravity.

See:
http://obi.virtualmethodstudio.com/tutorials/scriptingcollisions.html


RE: Obi Particle Trigger - Riscii - 15-01-2018

Hey! that was a quick response.
This is exactly what I was looking for, I'll check it out later today.