Softbody Scale - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Softbody (https://obi.virtualmethodstudio.com/forum/forum-12.html) +--- Thread: Softbody Scale (/thread-3733.html) |
Softbody Scale - patriot4947 - 18-01-2023 Hi, I have a softbody car and it is moving through x axis in 2d mode. I would like scale at the same time when I try to change scale of Obi Solver the car suddenly jumps forward because Obi solver scales from its centre. Is there any trick to solve this problem. I used LateUpdate to solve this problem. I am positioning car at late update but its position doesn't set. RE: Softbody Scale - josemendez - 19-01-2023 (18-01-2023, 07:48 PM)patriot4947 Wrote: Hi, Hi! Yes, you can translate the solver as well as scaling it. If you scale it by 0.5 in the X axis, translating it by 0.5*softbody.localPosition.x should keep the softbody from moving. (18-01-2023, 07:48 PM)patriot4947 Wrote: I used LateUpdate to solve this problem. I am positioning car at late update but its position doesn't set. You can't set the position of a softbody by setting its transform: it's made up of multiple particles, you need to move the particles themselves to translate it. You might want to do this manually using the particles API, or use softbody.Teleport(position, rotation); RE: Softbody Scale - patriot4947 - 21-01-2023 (19-01-2023, 08:59 AM)josemendez Wrote: Hi! I already tried your formula but for some reason it didn't work (Some errors occurred and I supposed these errors depend on the Obi package.). I made clean demo and everything worked fine. Thanks for your quick answer. |