Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Collision Detect
#1
Información 
I'm sorry for my bad english.
This is my first time using this package.
I want to detect particle and object collision. 

How can I do this? Or how can I tell if an empty glass is full?

As an example video: https://youtu.be/-rVaEEb4-vI?t=80
Reply
#2
Hi,

Subscribe to the solver's OnCollision event. See the manual for details:
http://obi.virtualmethodstudio.com/tutor...sions.html

The sample scene in the video (FluidMaze) is included in Obi 5.6 so you can just check it out and see how it was made.
Reply
#3
Thank you for the quick response. I don't know where to add the script Sonrisa
Reply
#4
(07-10-2020, 11:25 AM)sahin49 Wrote: Thank you for the quick response. I don't know where to add the script Sonrisa

Hi there,

If you're a beginner with Unity or programming, Obi will prove to have a really steep learning curve as it's aimed at medium/advanced developers. Medium programming skills, basic understanding of Unity workflows and basic physics simulation knowledge are taken for granted. My advice would be to get pretty comfortable with these before attempting to use Obi, or you'll get frustrated quickly.

Regarding your question: depending on how you write the component, you will have to add it to a different object. Typical use case is to add it to a ObiSolver component, so that you can get a reference to the solver using gameObject.GetComponent<ObiSolver>(), then subscribe to collision events.

This is what is done in the example script in the manual, as evidenced by the [RequireComponent(typeof(ObiSolver))] attribute at the top.

cheers,
Reply