If you need to achieve a more realistic bullet effect, this example may be helpful for you. You do not want your weapon to be a laser gun that directly hits the target without delay, but rather the bullet of the weapon has a flight time and a true hit position. This is a solution that I came up with, and its implementation is based on a combination of multiple rays. You can see a demonstration here: You can control the length of rays by using the value of fps to avoid the loss of ray events.
This video is an effect I used in my own game “localwar”