Hi, I’m making a game involving leasers and stuff ( How surprising D: !)
Anyways first thing that hit my mind was the line renderer , but there are few issues with the this approach.
*Collision detection will be more tricky, since the best way to do it is with rays, and the leaser it self will be moving
*It’s hard to play around with line renderers because they do not behave as simple gameObject.
Why line rederer ? Why not a simple plane or capsule ?
Well because i want to make these leaser beams reflect when they hit a wall.
Let’s imagine I’m using a Line Renderer. The visual approach of the reflection would be something like this:
-Tow line renderers one is filled 100% and the other 0% when hit a wall, the 100% lerps to 0% and the 0% lerps to 100%. But I have now idea how the collision detection will work with this.
one line renderer per transform though, so if you do use more than one it needs to be on a separate child etc. I’d really just go with increasing the point count of the one line renderer and have start, middle, end
This would make the leaser movement harder since I’ll be obliged to move the points of the child separately just for the reflection transition and the whole leaser gameObject is already moving.
actually, thinking about it, you might want to consider a TrailRenderer instead, I’ve not used them too much so you might want to have a play to see if it works for you, but I think they’ll implicitly handle the intermediate points as the lead of the laser bounces around.