Obi Official Forum
Unfix cloth on runtime - 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: Unfix cloth on runtime (/thread-413.html)



Unfix cloth on runtime - domkonecny - 25-02-2018

Hello, another question. 
I have my cloth that has some particles fixed through unity editor -> Particle editor . But at some point in the game i need to set all of these particles as unfixed. As is possible in the editor. Or in general.. how to acess all particle parameters (and possibly change them) on runtime (mass, radius, fix/unfix, phase, etc..) ?


RE: Unfix cloth on runtime - josemendez - 25-02-2018

(25-02-2018, 04:06 PM)domkonecny Wrote: Hello, another question. 
I have my cloth that has some particles fixed through unity editor -> Particle editor . But at some point in the game i need to set all of these particles as unfixed. As is possible in the editor. Or in general.. how to acess all particle parameters (and possibly change them) on runtime (mass, radius, fix/unfix, phase, etc..) ?

Hi there,

This is all covered in the docs:
http://obi.virtualmethodstudio.com/tutorials/scriptingparticles.html

To unfix a particle, simply set its inverse mass to something larger than 0. To fix it again, set the inverse mass to 0 (since 1/0 = infinity, by doing this you're giving it infinite mass and preventing it from moving).

cheers!