Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Gyroscope in fluid
#1
Triste 
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?
Reply
#2
(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.
Reply
#3
(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 .
Reply
#4
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!
Reply