(07-12-2020, 10:57 AM)josemendez Wrote: Hi there,Thanks so much for the detailed response, it makes a lot of sense.
I assume your solver does not move at all. While the solver is shrinking, you're propelling the softbody forward using a force (which is expressed and applied in the solver's local space).
Think about it: the behavior you describe is 100% correct and to be expected. Try picturing what happens when you scale a transform down, and the child transforms are not exactly at the parent's origin: they will get scaled down towards the parent. The same happens with actors inside a solver:
As long as the force you're applying displaces the softbody further away from the solver's origin than the scaling does, the softbody will move forward. At some point though, both displacements will even each other out (as the force is also scaled down with the solver, since it's applied in solver space), and shortly after that, the displacement due to scaling will be larger than the one due to the force:
The result is that the softbody moves forward at first, but progressively decelerates and then begins moving towards the solver's origin.
So this setup does not do what you were expecting. I don't know the details of your use case, though. If you could describe what you're looking for in detail, I would be able to suggest alternatives. The simplest thing that comes to mind is converting your force from world space to solver space before applying it. This way, as the solver gets scaled down, the force will be scaled up and compensate for it.
I like your idea of converting the force from world space to solver space. I'm not quite sure how to approach it, though. Currently, we are applying a force to the softbody in the solver with ObiActor.AddForce and a ForceMode of acceleration:
Code:
_softbody.AddForce(Vector3.forward * _acceleration, ForceMode.Acceleration);
Any ideas?