Skip to content

Creating your first light

GLide KS edited this page May 22, 2026 · 8 revisions

Before starting, you'll require at least basic lua knowledge do follow these steps, please reffer to Lua (SRB2 Wiki) in order to learn about this programming language and SRB2's functions and features.

However, feel free to copy any code shown here and give it some trial and error.

On this guide, we're using a lot the term "Corona" which is generally used to refer these lights back in SRB2 Final Demo

First steps

Make a blank lua script file, it could be inside your addon or just standalone.

To define and register an object to make it have a corona, we're using a table named LightObjects which tells Lighting System which objects will gonna have a corona.

We must make sure this table exists globally first, so in your first line of your script should have the following code:

if not LightObjects then rawset(_G, "LightObjects", {}) end

Clone this wiki locally