Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to change the 'Obi Solver' gravity ?
#1
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)
Reply
#2
You need to call solver.UpdateParameters() after changing gravity (or any other solver parameter) as per the api docs.

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