playMaker

Author Topic: How to have laser bounce off of walls at certain angles  (Read 283 times)

misterjuly

  • Sr. Member
  • ****
  • Posts: 346
How to have laser bounce off of walls at certain angles
« on: June 12, 2024, 04:50:06 PM »
Hello,

I’m trying to get visible laser beams to bounce of walls so that they go in a different direction (example have an object that shoots the laser beam then it bounces off of a diagonal wall then it’s direction continues but turned 90 degrees). I have messed around with raycasters 2d (this is a top down game like Zelda), line emitters and trail emitters but each seems to have their own problems with what I want to do though I’m not knowledgeable in any of those things. The closest thing I got to getting it to work was to increase the scale of the laser and use parenting shenanigans to get it pivoted right. Surely there must be a better solution, right? These lasers are for puzzle solving if that makes any difference. Thanks!

misterjuly

  • Sr. Member
  • ****
  • Posts: 346
Re: How to have laser bounce off of walls at certain angles
« Reply #1 on: June 12, 2024, 10:12:12 PM »
I figured out how to get the laser to bounce off of walls, but it is using a trail renderer and as a result is not colliding with anything. How can I make this trail renderer have a collider? Sorry if this should be its own thread. Thanks!