How particles follow the camera?

Basically, I’m trying to create my own particle system as the Roblox one doesn’t emit light or shadows but I got a problem, the particles look weird when looking at the camera

This is my current code to make them follow the camera

particle.CFrame = CFrame.lookAt(particle.Position, camera.CFrame.Position)

This is what I want

This is because each particle is looking at the camera from there position instead of each particle looking at the same direction one particle is looking from one position.

1 Like

your problem is that they are changing their angle so that they point towards the cameras position, so the ones further to the left/right will angle more inwards. what you want is for them to all be oriented opposite to the camera’s lookvector, regardless of position.

(particle.Position - camera.CFrame.LookVector) creates a point in space which is directed away from the particle in the opposite direction that the camera is pointing, which you can use as your subject for CFrame.lookAt()

so then your particle CFrame should look like this:

particle.CFrame = CFrame.lookAt(particle.Position, particle.Position - camera.CFrame.LookVector)

2 Likes