Obi Official Forum
Help Gyroscope in fluid - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html)
+--- Thread: Help Gyroscope in fluid (/thread-2809.html)



Gyroscope in fluid - enchu_99 - 15-03-2021

Hi, Can I do gyroscope to control the 2d fluid?  Triste I cant figure out how to control the water by using gyroscope controller? is it impossible to do it?


RE: Gyroscope in fluid - josemendez - 15-03-2021

(15-03-2021, 03:37 PM)enchu_99 Wrote: Hi, Can I do gyroscope to control the 2d fluid?  Triste I cant figure out how to control the water by using gyroscope controller? is it impossible to do it?

You can just set the solver gravity, it's pretty easy:

Code:
solver.parameters.gravity = <your accelerometer gravity>;
solver.UpdateParameters();

How to get the gravity value measured by the hardware varies depending on which input system you're using.


RE: Gyroscope in fluid - enchu_99 - 16-03-2021

(15-03-2021, 03:52 PM)josemendez Wrote: You can just set the solver gravity, it's pretty easy:

Code:
solver.parameters.gravity = <your accelerometer gravity>;
solver.UpdateParameters();

How to get the gravity value measured by the hardware varies depending on which input system you're using.
hi thanks for replying. Can I know where do i put these code in which scripts? I know it sound stupid but i am a beginner in this .


RE: Gyroscope in fluid - josemendez - 16-03-2021

Where to put it is completely up to you, typically you'd place it in some script's Update() method.

Note that Obi is a quite complex engine aimed at advanced users, if you're starting with Unity and/or programming it might prove a bit too daunting at first. Fluid simulation shouldn't be your first contact with game making.

cheers!