Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SOLVED - What's the better way to track Soft Body position?
#2
(31-08-2020, 09:46 PM)the-lander Wrote: Hello everyone!

Does anyone knows a good way to track SB position reliably and smoothly?

https://youtu.be/rYDHcSxnrws
Here in the video you can see:
- a blue translucent SB
- a gray sphere, a child of the SB
- a camera (well, you cannot see it but it's there obviously)

SB is moved via constant AddForce(direction * force * Time.deltaTime,ForceMode.Acceleration). The sphere is just a child, no code there. The camera tracks SB transform position and lerps there with a factor of 0.1.

As you can see, the sphere is always ahead of SB and is jerking all the time, while the camera moves smoothly (not at the top speeds) but is always behind. Is there a way track that SB so it will look smooth? I don't know, maybe the average position of every particle will work. Still have to figure how this will work. But still, looking for a good way to make tracking SB as smooth as possible.

I have a similar setup where a camera needs to follow a softbody smoothly and the only way I found to make it smooth was to use softbody.GetMass(out centrePosition) and update the camera in LateUpdate. Worth a try at least if you haven't already.
Reply


Messages In This Thread
RE: What's the better way to track Soft Body position? - by MattS - 31-08-2020, 11:22 PM