Obi Official Forum
Help Change aero constraint properties with script - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Cloth (https://obi.virtualmethodstudio.com/forum/forum-2.html)
+--- Thread: Help Change aero constraint properties with script (/thread-632.html)



Change aero constraint properties with script - domkonecny - 19-07-2018

Hello
I want to change air density on my cloths on runtime. It works perfectly well if i change it manually in editor. I am probably just missing some call, and I cant find it in the docs. 
Now it looks like this.

Code:
ObiAerodynamicConstraints aero;
aero = this.GetComponent<ObiAerodynamicConstraints>();
aero.airDensity = 0.04f;

The value changes on the component in editor, but has no effect.


RE: Change aero constraint properties with script - josemendez - 19-07-2018

(19-07-2018, 03:54 PM)domkonecny Wrote: Hello
I want to change air density on my cloths on runtime. It works perfectly well if i change it manually in editor. I am probably just missing some call, and I cant find it in the docs. 
Now it looks like this.

Code:
ObiAerodynamicConstraints aero;
aero = this.GetComponent<ObiAerodynamicConstraints>();
aero.airDensity = 0.04f;

The value changes on the component in editor, but has no effect.

You need to call

Code:
aero.PushDataToSolver();



RE: Change aero constraint properties with script - domkonecny - 19-07-2018

(19-07-2018, 04:23 PM)josemendez Wrote: You need to call

Code:
aero.PushDataToSolver();

I knew I was missing something so simple!
thank you so much