Localized particle acceleration?

The acceleration property for particle emitters is one I really want to use for certain tools, however the fact that the particle acceleration is determined by the global axis instead of being relative to the part has made it impossible to use in tools and parts that are going to be moving.

Is there a way to work around this? My first thought is to do some math and make a formula to calculate where the particles should go based on a part’s orientation, but with that I’m not sure where to start.

ezgif.com-video-to-gif-converter

I’m referring to how the bubbles converge back towards the center just a little before disappearing. I recreated the effect in studio but if the part is rotated the particles will not go in the desired direction anymore.

2 Likes

Bumping this older post but this should help anyone looking for localized particle acceleration:

If LockedToPart is disabled, then the Acceleration will be determined by the global axes. If LockedToPart is enabled, then the acceleration will be determined by the part’s local axes. This behavior doesn’t appear to be documented for particle emitters!

If you want the particles to move according to the part’s local axes but not be locked to the part, then you’re going to have to update the Acceleration property based on your part’s orientation.

For example, let’s say you wanted your particles to move in the ‘forward’ direction of some part, you can calculate what that global acceleration would be by doing the following:

someEmitter.Acceleration = somePart.CFrame:VectorToWorldSpace(-Vector3.zAxis * 100)

The above takes a local vector in the perspective of somePart.CFrame. The local vector -Vector3.zAxis * 100 is a vector that is 100 studs ‘forward’ in the perspective of that CFrame. By converting this local vector to world space, we’ll get a vector that represents this acceleration in the perspective of the global axes.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.