hello, it had happened to me before that when I added the lightning bolt to my project it would work then I would leave the editor and go back in and run my game it would not work, if not only did the lightning bolt work or was activated until I clicked on one of the elements of my game, but not the game running but in the editor.
Although for a strange reason the error corrected itself and when I enter my game and run it immediately without clicking on an item before executing it, the beam works normally without problems.
Although there is a strange error of the ray that happened to me days ago, I could not describe very well why it happens, but the ray only collides when it touches the center of an object and not its ends, currently it is not much of a problem but it has happened to me