Obi Official Forum
Moving an ObiCloth GameObject by code - 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: Moving an ObiCloth GameObject by code (/thread-74.html)



Moving an ObiCloth GameObject by code - matchalover - 15-08-2017

It seems like we can't have movement on an ObiCloth GameObject by Unity code. I have tried to use GO.transform.position but it just move its collider not its ObiCloth component. Are there any way to make an Obi object to move?


RE: Move ObiObject ! - josemendez - 15-08-2017

(15-08-2017, 03:04 PM)matchalover Wrote: It seems like we can't have movement on an ObiCloth GameObject by Unity code. I have tried to use GO.transform.position but it just move its collider not its ObiCloth component. Are there any way to make an Obi object to move?

Fixed particles obey the transform, unfixed particles obey the simulation. So if your cloth has no particles fixed, it will just follow the simulation. Fix a few particles in your cloth using the particle editor and they will follow your cloth's transform.

Edit: Also note that for a cloth with no particles fixed (all of them moving freely), the notion of whole object "transform" doesn´t make sense: the cloth can bend, stretch, compress... what are its "position", "rotation" and "scale"? There's no obvious "center" to define its position, no orientation or scale for a deformable object.