03-01-2023, 11:36 PM
(This post was last modified: 03-01-2023, 11:41 PM by josemendez.)
(03-01-2023, 10:47 PM)louiemed Wrote: Hello, my apologies if a similar question has been asked but I could not find anything in the forum. This question has 2 related parts.
I recently purchased Obi Fluid, so I am still learning/exploring its capabilities. I have been studying the various sample scenes to see what the program is capable of. I thought the FluidOverlapQuery scene was really interesting, but I had trouble adding onto the example.
I created a new cube, removed its mesh renderer, and made sure it was lined up with the existing cubes. I then added an element to the Overlap Test script component, and assigned it as my new cube. I expected to see my new cube appear "in" the water, as the other two in the example do, but it did not. I imagine I missed a step in the process or failed to set something up properly, so I am here asking what I should check.
I was also wondering if it is possible to use this same script for 3D objects that are not cubes. I have a 3D model of the logo of the company I work for, and I think it would be cool to have it appear in the water as the cubes do in the sample scene. Is this achievable, and if so where should I begin implementing such a feature?
Thanks in advance, and apologies if this is a simple question.
Hi there!
Spatial queries are limited to rays, boxes and spheres. They mimic Unity’s own raycast, boxcast and spherecast, but optimized to deal with hundreds of particles in parallel. See the manual for details: http://obi.virtualmethodstudio.com/manua...eries.html
These are typically used to determine whether fluid is inside a specific area for gameplay purposes, using queries to draw shapes is not recommended since it’s a very inefficient use of them. If you want a logo to appear inside the liquid, placing a simple textured mesh behind the fluid is much simpler, performant, and will look better.
Kind regards,