Hi, Can I do gyroscope to control the 2d fluid? I cant figure out how to control the water by using gyroscope controller? is it impossible to do it?
Help Gyroscope in fluid
|
15-03-2021, 03:52 PM
(This post was last modified: 15-03-2021, 03:52 PM by josemendez.)
(15-03-2021, 03:37 PM)enchu_99 Wrote: Hi, Can I do gyroscope to control the 2d fluid? 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>; How to get the gravity value measured by the hardware varies depending on which input system you're using.
16-03-2021, 06:38 AM
(15-03-2021, 03:52 PM)josemendez Wrote: You can just set the solver gravity, it's pretty easy: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 .
16-03-2021, 08:06 AM
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! |
« Next Oldest | Next Newest »
|