Creating A Laser Wall Challenge In Unity

Today I am creating a pretty simple laser wall challenge that the player must carefully navigate through.

Today’s Objective: Create a simple yet dangerous laser wall as an obstacle to the player’s progression. Players must time and jump through the gap as it flickers.

The Code:

The code is especially simple for this design. Since I want/need the player to be able to predict when the lasers will turn off, the lasers must flicker in a repeating pattern. To make that easier to create and modify, I will use an Animation Curve:

While the same lasers currently always flicker (for simplicity), WHEN they flicker is different for each wall
I create the patterns using the Curve editor, where 1.0 is ON and 0.0 is OFF.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Vincent Taylor

Vincent Taylor


Unity game developer / C# Programmer / Gamer. Australian (Tasmanian) indie games developer for 10+ years. Currently looking for games industry employment.