How do i make a laser effect?

I want to make a laser that adapts to the surface its hitting, making it so that it isn’t to big or small. Is there any way to do this? Raycasting would be very inefficient due to it taking a lot of resources to make a ray every frame.

(Doesn’t need to be pretty or anything, and i tried to use attachments but it didn’t work because it kept moving and didn’t shrink, and if you don’t understand what i’m talking about ill try to demonstrate to the best of my ability)

1 Like

Personally I create rays in a loop and position an attachment to the ray result. The origin / muzzle of the laser is an attachment which uses the other attachment in a beam which represents a laser. I don’t find it to be too taxing so long as I keep code within the loop minimal and don’t run it every single frame.

You can cast a ray every frame and have excellent performance, if you want then you can make a setting where the player can limit how fast the laser updates.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.