Hey there! First off this plugin is fantastic, thanks for going through the effort of developing and maintaining it over all the years (and not even paywalled!)
I have noticed the behavior mentioned
earlier in this thread, and I have a suggestion for how you might be able to make it more natural, if you would be open to that?
I do know a bit about 3D math and game dev, though I don't work with Unity a lot (and I have no idea how much VAM actually exposes to the plugin system), but I could take a look at the code and help troubleshoot any problems you run into if that would be useful. (Or I could even take a shot at the initial implementation if you're interested.)
The basic idea is:
- Detect when particles hit a collider
- Find the transform root of that collider
- Depending on the "stickyness" parameter, manually adjust the position of the colliding particle by taking into account the collider transform's motion between frames
If the colliders have some sort of "velocity" property, that would make things easier, otherwise you would have to manually compute it by storing a reference to the relevant colliders and taking the difference of their current position from their position on the previous frame (or physics tick, if applicable).
You may also need to transform the collider's current/previous positions into world-space if they're only given in local space (ie multiply each by the inverse of the world-space transform before taking the difference). Once you have the world-space collider position delta, just add that to the particle's world-space position each frame (or physics tick) as long as the particle is still "attached" to the collider.