Is there a way to make beams appear in front of/behind particles at all times?

So as the title suggests, I want to make the beam behind the particles at all times, ZIndex doesn’t work infact it doesn’t do anything:
https://i.gyazo.com/4ca2979846aa28b9a85cdc17ca97d19d.gif
Here’s the explorer:
image
Properties of the beam:


Properties of Particle1:

Properties of Particle2:

Properties of Particle3:

Properties of Particle4:

Maybe make the particles move just a little bit outwards?
You could also manually position the beam attachments being the particles every frame.

There’s no real way otherwise I’m afraid.

May I get an example as to how to do that since I have very basic knowledge about CFrame and Cameras

It may not be a good idea then.

I believe you’d want to do something like this:

local StoredBeamLocation = Beam.CFrame

RunService.RenderStepped:Connect(function()
    Beam.CFrame = StoredBeamLocation + (Camera.CFrame.lookVector.unit * 2)
end)

(2 being the studs moved)

Yeah it still doesn’t work, I guess it’s on the engine.

Probably due to the size of the beam - try increasing the stud number.

And yeah rip

I never understood particleemitter ZOffsets. It seems to change the distance from from the camera that the particles are visible in my eyes. I doubt there isn’t more to it though.

Its the same thing as the ZIndex of GUIs, it just determines the order that the particles appear in, being in the foreground or in the background.

Well, not exactly. It’s more of a combination of changing the position and changing the order. While it does function like the Z-index property of GUIs, it can also change what particles are displayed to the camera. For example, if the ZOffset property is set to 10, all particles within 10 studs from the CurrentCamera are rendered invisible.

As for your original post, I think I’ve found a solution by setting the ZOffset to an extremely low number (-40 to -50 was working for me). The root cause of the issue is the fact that particles from the ParticleEmitter rotate to face the camera, and if your camera is above the emitter, the particles rotate behind the beam. I should also note that I gave all the particle emitters positive ZOffsets, but I don’t think that should affect the end beam.
Laser Doge.rbxl (14.4 KB)

2 Likes

Thanks a lot!