Answer the question
In order to leave comments, you need to log in
Unity, how to dynamically calculate the fullness of an object (bottle)?
Hello! I have a bottle on the stage, various details fall into it from above, but they are sometimes of a random size, to the right of the UI Slider bottle, in which I would like to implement the display of fullness, i.e. for example, 3-4 parts fell into the bottle and we show on the slider that the fullness is 4%. How can this be implemented? Please help, thanks in advance.
Answer the question
In order to leave comments, you need to log in
I would let a lot of rays in the bottle, they were small (like dots), evenly over the grid (for example, 100x100x100), I would take it into account if it is inside the bottle. you will get "A" of such rays, you will find out how many of them came into contact with the details - "B", divide B / A - here are the ratios of filling the bottle with details
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question