GetAssetPack

Light Optics

Light Optics
Price
$12.99
Creator
BloxPacks
Genre
Puzzle

A Roblox Luau module simulates light reflection, refraction, dispersion, and focusing through mirrors, prisms, and lenses for interactive optics puzzles.

Real light for Roblox puzzles: beams that bounce off mirrors, bend through glass and split into a rainbow.

Available on

Search by image

Upload a reference to find previews with similar colors, contrast, and detail.

Light Optics

Light Optics1 / 3
BloxPacks · itch.io$12.99
License not indexed
  • i Check the terms on the original listing.
Show full terms

Real light for Roblox puzzles: beams that bounce off mirrors, bend through glass and split into a rainbow.

A Roblox Luau module simulates light reflection, refraction, dispersion, and focusing through mirrors, prisms, and lenses for interactive optics puzzles.

View original listing

Description

Light Optics is a drop-in Luau module that traces real light through your place. Point a lantern at a mirror and the beam reflects at the angle it should; send it into a prism and it bends by Snell's law and fans out into a rainbow, violet bending more than red, as in real glass. A lens focuses a wide beam down to a point at its focal length. Targets light up when the right colour reaches them: the red crystal only for red, the sun disc only for a focused beam.

Show full description...

It is server-authoritative. The server traces the parts as they stand on the server and decides which target is lit, so no client can light a target that is not lit for real. Players turn mirrors and slide lenses with mouse, touch or gamepad; every request is checked on the server. An optional client module draws the light: white beams that glow, coloured light as pure ribbons, the rainbow painted on the wall where it lands.

Features

  • Real optics, not canned paths: reflection, refraction by Snell's law, total internal reflection past the critical angle, dispersion by Cauchy's law, thin lenses and curved mirrors that focus.
  • A rainbow you can aim: white light splits into seven bands the first time it enters glass. Two display glasses fan the colours across a room; three real glasses (BK7, SF10, fused silica) spread them as true glass does.
  • Targets with rules: the colours a target wants, a focused beam only, how long the light must rest on it, and whether it stays lit once lit. TargetLit and TargetUnlit tell your code.
  • Pieces players move: MakeMovable turns any mirror, prism or lens into a piece that turns about an axis or slides along a rail, with detents and a range. Mouse and touch drag it through a DragDetector; gamepads nudge it a detent at a time.
  • Safe from hostile clients: a player may hold one piece, only from within reach, only one player at a time; poses snap to the piece's detents inside its range; requests are rate-limited per player; an optional CanGrab callback adds your own rules.
  • Two ways to set up: call AddMirror, AddPrism, AddTarget and the rest from a script, or tag parts in Studio and set attributes. Both work the same, before and after the game starts.
  • Light on the server: the scene is traced only when something moved. A trace of the example room took 0.02 ms on the Studio server; the worst case the test suite builds (160 segments, the cap) took 0.77 ms.
  • Tested: an automated suite (248 checks) covers the laws (every band's angle through a prism matches the textbook formula to 1e-4 degrees), the trace limits, the target rules and the moving pieces, and runs the server and the client in a stand-in engine against every kind of malformed and flooding client request, plus seeded random sessions of valid and hostile traffic.

What's included

  • The LightOptics module, as source (Luau) and as a ready-to-insert .rbxm model: the server system, the optional client look and a ready-made glass prism.
  • An example place: a workshop room with a lantern, two mirrors on turntables, a lens on a rail and a prism on a pedestal. Light the red crystal, the violet crystal and the sun disc to open the door; a lever puts everything back. A short server script and a short client script with gamepad controls, ready to copy.
  • A README with install steps, the full API, every option with its default, the tags and attributes, how it works, measured performance and known limits.
  • The test suite (runs with Lune) and Rojo project files.

The screenshots come from the included example place.

Requirements

  • Optical parts are BaseParts in the Workspace; glass is read as a triangular or box-shaped block.
  • Light travels in straight lines between surfaces: no diffraction or partial reflection.
  • Pieces players move are placed by the server; anchor them.

Support

Questions and bug reports: post on this page's community board. Please include your Roblox Studio version and a short description of the place.

Tags

lightLuaumoduleopticsPhysicsrainbowRobloxRoblox Studioscripts

Downloads