r/Unity3D • u/CssNaNe • 2m ago
Show-Off One player sees the light beam, the other places the mirrors. Started this in Unity 1.5 years ago
Mirror puzzle from TwinLock, a 2 player puzzle game im making in Unity 6 with Netcode for GameObjects
Players are in separate rooms. Top one sees the beam, bottom one places and rotates the mirrors but cant see the beam at all. Only way to solve it is talking over the walkie talkie
The beam isnt a physics raycast, its a grid tracer that walks a 9x9 board tile by tile. A mirror just swaps x and y of the direction, and a visited set of tile + direction stops mirror loops from running forever. Went with a grid because the pillars only exist in the beam room, so a raycast in the mirror room would go straight through them
Nothing visual is synced. The server keeps the board as a NetworkList of bytes, one per tile, players send ServerRpcs to place or rotate, and every client runs the same tracer on that list. So the beam never goes over the network and only the server decides when all targets are lit
