I want to make a puzzle where the player need to reflect a ray of light light using rotatable mirrors(2d, Im using sidescroller) , what should I do? I have knowledge at Programming. I just cant come up with an algorithm using the unity objects.
From the starting position, Raycast() outward. If the Raycast() hits anything, then the RaycastHit.point and the RaycastHit.normal can be used with Vector3.Reflect() to figure out the start and direction of the next Raycast().
Note someone was working on something similar (not precisely this game, but having a ray bounce around) in the last 90 days. His post included a bit of source that might help you, so you might want to poke around on UA to see what you find.
Hi, I made asset that is solved your problem
You can get in on AssetStore: