What method would I use to create a solid laser beam and have it stop at walls?
I can make the beam I am assuming using the line renderer and some particle effects. I am not sure how I would stop the beam from going past my walls. Also I am not positive of how I would set a collider to the line (I’m not at home in Unity right now so that may be an easy thing to do I just can’t see it right now)
But I know that I don’t know how to stop the beam. What would I need to do to make that happen?
Shot a raycast, and scale your beam with its length?
I need the beam to stop at walls… So it doesn’t shoot through that object.
A raycast stops at collider/collision. Isn’t that what you want?
so create a line renderer to scale to the length of the raycast and it will do what I am asking?
A line renderer, a cylindrical mesh, two planes in X… The rendering is up to you, but yeah, the raycast has an origin, and the RaycastHit has a point in space where it hits. Substract both, and you get a vector with the proper length.