Beam Reflection

Hello !

I want to create a game for the University competition. I work in Unreal Engine 4, but I have a problem. I don’t know how to create a beam that has the propriety to reflect when it touches a certain object (like a mirror). Like this thing . I’m a beginner to engines at all. I found this interesting thread, that I think it may solve my problem A laser that reflects in a moveable mirror - UE4 AnswerHub , but when I try to edit the material, I don’t know what function to use. I saw that there are some symbols before the function name, I searched for a classification or a list with those symbols, but couldn’t fine one, so I don’t know what function to select (after I right click) in order to create that scheme. The beam that I want to create is an continuous beam that passes across the room and it’s direction will be altered by some mirror-like objects.
EXAMPLE: The beam goes trough the room, it hits the obstacle number 1 and it will be reflected by an angle, then it hits the obstacle number 2 and so forth . If I displace the object 1, the beam should change it’s direction (Updating it’s path)
Any leading tips would be realy apreciated.


This is done using light traces and either mesh + material or particles.

Here’s one way of implementing the visual beam: think you can find it already implemented in the Content Examples in the Learn tab.

Another beam tutorial:
Do this for every Event Tick(frame):

  1. You do a line trace from the point of origin (weapon) in the direction to which you want your laser to go.
  2. If the line trace hits an object, get the material of the object hit by the line trace and you check if that material is the mirror material.
  3. Draw the beam between the two points of the line trace
  4. Then, if the material hit earlier is a mirror, get the angle of the line trace against the surface of the mirror mesh (the incidence angle), then mirror that by the surface normal to get the reflected light direction vector.
  5. Now, do another line trace from the inpact point in the direction of the reflected light.

You repeat the steps 2 to 5 each time you hit a mirror material.

Thx, contest already over, got 3rd place :smiley: