Download

Deflection mechanic - need some guidance

Hey All,

I’ve been working on creating a laser with collision checks, getting pretty close to how I want it to work.
My next step would be to have an object that is able to deflect that laser, and have the laser beam continue with the deflected angle accounted for. This is where I’m not really sure how this could be implemented, as I am still learning UE4.

If anyone has any insight or where I should look to learn about this, or something similar, that would be awesome.

A couple questions I can think of right away;
-Would I need to create a new beam from the deflection point?
-Or can one beam be “bounced” around? Spline be used to dynamically change when objects intersect/deflect?
-Can collision detection still be present with newly deflected beams?

Appreciate any tips or advice! Cheers

Excellent question!

In fact interesting to the point where I sort of couldn’t resist building an implementation that does a whole lot of laser deflection! Adding proper explanations here would take as long as it did to build it, so I won’t be doing that… Instead you can simply download the project and have a look at it. Added a fair amount of comments in the blueprints, so hopefully it should be easy enough to understand how it works.

Might not be perfectly suited to your exact needs, but at least it’s a starting-point to build upon.

Download here (UE 4.8.3 project, zipped with 7-Zip) -> https://dl.dropboxusercontent.com/u/2888286/LaserDeflection.zip

In short: yup, a new beam from every deflection point, and collision detection is still active for “secondary” beams down to an arbitrary depth. There’s a recursion limit set in this project, but it can be changed to any number.

Awesome! Thanks for responding and taking time to actually put something together!
I will definitely check this out tonight, can’t wait to see how you approached it.