Obi Official Forum
how to change the 'Obi Solver' gravity ? - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: General (https://obi.virtualmethodstudio.com/forum/forum-5.html)
+--- Thread: how to change the 'Obi Solver' gravity ? (/thread-2649.html)



how to change the 'Obi Solver' gravity ? - ayoubb20 - 19-12-2020

Hi there ,
I am trying to customize the gravity through script when the player press on a key
the script works well , 
and the values of the gravity is changing in the inspector well.

but the problem is that the effect of the changed values is not applied in the scene
as if you can see here is the normal values that i set mannualy before running .
Image normal Values (-3 , 0 , 0 )
and here when i clicked on a key the values has been changed changed Values (6 , 1 )
( as if you can see the fluid does not change its direction , that is the problem  Huh)

 

but i observed a thing that when i pause the 'Play mode' and change around the values of other variables and resume 'Play mode'  the direction 
is changing smoothly to the changed values  (6 , 1 )

here is an example : 
- i changed the 'Interpolation' from None to Interpolate 
- and problem was solved .

 but i need a way to change it automatically with the script if it is possible 

(thanks in advance  Corazón)



RE: how to change the 'Obi Solver' gravity ? - josemendez - 19-12-2020

You need to call solver.UpdateParameters() after changing gravity (or any other solver parameter) as per the api docs.

Cheers!


RE: how to change the 'Obi Solver' gravity ? - ayoubb20 - 19-12-2020

josemendez
Cheers!
 I am very thankful for you Mr jose  Corazón Corazón