How would I prevent particles from going beyond when a part resizes?

  1. What do I want to achieve and what is the issue?

How do I prevent the particles from going too far off (ex: the back of the player) when the part (continuous beam attack) resizes? This happens when a part quickly resizes, such as a beam attack originally being aimed at the sky but suddenly aiming it at the ground.

  1. Example images?



  1. What solutions have I tried so far?

I once tried making it so the particles start from the player (parented to a different part). That poses another problem: through walls. The particles would still show through walls even when the main part (damage part) doesn’t.

2 Likes

You can fix this issue by enabling the LockedToPart property of your ParticleEmitters.

Particle Emitter - LockedToPart property (Documentation)

2 Likes

This isn’t what I’m talking about. It’s when the part resizes, not moves. If a part resizes and the particles have LockedToPart, the particles still linger out of bounds.

2 Likes

I’d say adjust the lifetime maybe? So that when it does linger, it lingers for less time.

You said that changing the LockedToPart property only works when the part moves but I believe when you resize a part, unless it is done independently of its origin, it also moves the part.

Another potential solution is instead of resizing the part you just duplicate it but with a new size, and delete the part that had the previous size therefore also deleting the particles that would linger. (probably not the most optimized option + not sure if it would actually work)

Or it could have something to do with the emitterShape and the shapePartial (non-box shapes)
I set it to 0 and there didn’t seem to be any lingering.

2 Likes

i don’t want the beam going through walls

1 Like

I’ll try that. I have a feeling it might work because when you reparent a particle emitter, the old particles don’t disappear.
UPDATE: it didn’t :sob: (it still had to wait for the old particles to disappear)

1 Like

what if you use an attachment?

1 Like

wdym? like the particles emit from a different area or something?

1 Like

Like if you put the particle emitter in an attachment and put the attachment at the end of the part or wherever you want the particles to come from. You could rezize the part and the attachments would be unaffected. Attachments can’t resize as they are (implied) one-dimensional so the particles only come from a single point and therefore when you use the LockedToPart property the particles will move.

Or looking back on this idea

instead of deleting the part, move it. and since LockedToPart is true. The old particles should move with it.

1 Like

but you’d also have to wait for the new particles to generate, which can get very seizure-like

1 Like

ok what if instead of moving the particle emitter and respawning a new one. what if you already had one that was generating particles at the desired length then you could just move the two particle emitters in and out… or something

or like if you disable locked to part and move the particle emitters fast enough, the particles would linger where they are supposed to be ((which would get rid of this

but still not allow the particles to linger in the wrong spot))
have you tried my other suggestion? how did it go?

this fixed the main problem but i encountered another one (will edit this post with an attached video)

the (old) particles still go through the part for a short time

sorry for the misunderstanding. the new issue could likely only be fixed by lowering the lifetime and upping the speed, as there is no way to remove those residual particles.

1 Like

actually i guess i’ll try a new method altogether… i have 2 methods available