How to approach bullet tracers? (Ex: Phantom Forces bullet tracers)

bumping this topic again, i have working bullet tracers but troubles with the origins, the beams start too far away sometimes (not always) and i want a solution for fixing this

I just put the trails in parts and add velocity to them, it’s pretty nice too

1 Like

Bumping this topic because I found another good method;

Unfortunately I cannot simulate the system where there is a dot when the camera isnt moving (yet), but I have found that finding control points on a bezier curve where the last 3 positions and the current position pass through looks pretty good; Example:

In order to make it move with the camera, you have to store positions that are relative to the camera (CurrentCamera.CFrame:PointToObjectSpace for example) and then you have to get the new position by translating it back into world space and doing your calculations with that variable. If you keep updating the old p0, p1, and p2 variables with the new object space coordinates, it should work.

I would explain the math behind getting control points, but unfortunately I did this a long time ago and I just wanted to quickly show my method. It’s mainly just algebra at the core

Here’s a Desmos graph with equations and a visualization: bezier refit | Desmos

11 Likes

yeah this is the way pf handles bullet tracers, I have a modulescript that does virtually the same thing this video shows

1 Like

Does your implementation retain full continuity of the bezier? How do you make it so that the back portion of the beam overlaps with the end of the previous beam?
I wrote about this in detail here: How to get control points of bezier curve from start end and midpoint while retaining continuity?
What a three-point implementation without continuity looks like:

1 Like

Setting this as the solution! Awesome work, I forgot I’ve made this post.

1 Like

This implementation does not support continuity and I’ve realized that when it approaches higher velocities / changes in points. I was trying to find a way to fix it when I created the post but I’ve been busy working on other projects as recent and I might re-attempt this later