Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  How to change gravity in script during runtime?
#1
I've just gotten Obi Fluid, and after a lot of experimenting and tinkering, managed to get it to work reasonably well in a Unity project I'm working on. Really cool! However, I would like to/need to be able to change the X and Y gravity Obi Solver settings in script during runtime, but don't see how this is done. I've been looking at the API docs and haven't found what I would need in order to accomplish this. I'm using Unity 2020 and C#.

Any help is appreciated!
Reply
#2
Code:
solver.parameters.gravity = <your gravity>
solver.UpdateParameters();

Cheers!
Reply
#3
(24-01-2021, 11:26 AM)josemendez Wrote:
Code:
solver.parameters.gravity = <your gravity>
solver.UpdateParameters();

Cheers!


Hi. I've a problem...
Solver.UpdateParameters() doesn't exist...


Attached Files Thumbnail(s)
   
Reply
#4
(02-05-2021, 09:32 PM)Ed_looping Wrote: Hi. I've a problem...
Solver.UpdateParameters() doesn't exist...

If you look at the API docs, you’ll see it has been renamed to PushSolverParameters() in newer versions.

Cheers!
Reply
#5
(03-05-2021, 08:05 AM)josemendez Wrote: If you look at the API docs, you’ll see it has been renamed to PushSolverParameters() in newer versions.

Cheers!

Thx Sonrisa
Reply