Help Reset cloth from 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 Reset cloth from script? (/thread-1679.html) |
Reset cloth from script? - nsxdavid - 07-02-2020 I need to be able to reset the cloth I have on a character (not skinned cloth in this case, but also will have that too) when an animation starts, or when the character is suddenly repositioned from script. As it is now, a huge impulse is imparted and the cloth goes swinging around wildly in such situations. How is this done? David RE: Reset cloth from script? - josemendez - 10-02-2020 (07-02-2020, 11:41 PM)nsxdavid Wrote: I need to be able to reset the cloth I have on a character (not skinned cloth in this case, but also will have that too) when an animation starts, or when the character is suddenly repositioned from script. As it is now, a huge impulse is imparted and the cloth goes swinging around wildly in such situations. It depends on whether you want to reset the simulation, or simply prevent character repositioning to affect dynamics. I suspect you're after the latter. In that case, you can simply set the solver's inertia scales to zero, reposition the character, then set them to whatever they were in the next fixed update. See world linear/angular inertia scales here: http://obi.virtualmethodstudio.com/tutorials/obisolver.html RE: Reset cloth from script? - nsxdavid - 10-02-2020 (10-02-2020, 10:49 AM)josemendez Wrote:Quote:It depends on whether you want to reset the simulation, or simply prevent character repositioning to affect dynamics. I suspect you're after the latter. In that case, you can simply set the solver's inertia scales to zero, reposition the character, then set them to whatever they were in the next fixed update. RE: Reset cloth from script? - josemendez - 13-02-2020 See this other thread, might be helpful: http://obi.virtualmethodstudio.com/forum/showthread.php?tid=2044 |