➡️Light

GAME MAKER 0.10 UPDATE

This logic was moved from a behaviour to a component for more interconnection of logic. Documentation is being updated.

PERFORMANCE TIP In multiplayer Experiences, there are two layers of logic that will not communicate with each other: singleplayer [SP] and multiplayer [MP]. For best performance, only apply [MP] behaviours and components to objects that MUST be synchronised to all players (or communicate on that layer), and maximise use of the [SP] (Client Only) layer.

USAGE TIP This behaviour will not communicate with Quests or [SP] behaviours or components. It can be used in singleplayer Experiences.

Common Uses

  • Light fixtures, spotlights, campfires, soft glow to emphasise emissive Assets

  • Dark spaces with negative light

  • Child Objects for pickable items (flashlights, torches, etc), moving Objects (vehicle headlights), etc.

  • Visual hints or puzzles

  • Localised ambience and storytelling

Communications

Inputs:

Outputs:

Parameters

OptionsDetails

Light Type (dropdown) - Choose the type of light you want to use. Point Light emits light all around the Object. Spot Light emits light in front of the Object.

Starting State - Determines whether the light source is on or off at the beginning of the game.

Intensity (slider) - Determines the brightness of the light.

Range (slider) - Defines how far from the source the light will reach.

Falloff (slider) - Increase or decrease the falloff strength of the light.

SpotAngle (spot light only slider) - Determines the cone-shaped angle that the light in front of the Object will emit within.

Light Color - Select the colour of the light from a color picker or by inserting a Hex Code.

Subtractive - Determine whether you want the light to be subtractive.

Message to Turn ON - Add the message(s) required to turn on the light. Message to Turn OFF - Add the message(s) required to turn off the light.

WHAT IS IT?

The Light Behaviour can be used to create individual light sources anywhere in a scene and can be customised to change the look and feel of an experience by adjusting its colour, intensity, position, and distance the light will travel.The Lighting Behaviour can also be turned on and off using messages, which means one experience can have many lighting states. Being able to custom lights is also a great way to brighten up areas of an experience that might not have direct light from the environmental lighting, like caves, tunnels and buildings.

A MULTI-PLAYER BEHAVIOUR

All players in the experience will be able to see the same lights, with the same configuration, behaving in the same way.If the message required to trigger a lighting state change is driven by player action, then the lighting state can be triggered by ALL players.

APPLYING THE BEHAVIOUR

Because this Behaviour is multiplayer enabled, make sure to select ‘Synchronized’ in the Behaviour selection window when adding it to an Object.It’s recommended to use logic entities with Light Behaviour.This makes them easier to identify in Edit Mode and reduces the face count in an experience, which improves performance.

PARAMETERS

The Light Behaviour supports previews in edit mode, so you can adjust light parameters and see the results in real time.

Light Type

Point Lights

Spot Lights

Starting State

This variable uses a toggle to define if the Light Behaviour is initially On or Off.Setting the toggle to OFF means the light will be inactive when the experience loads.Setting the toggle to ON means the light will be active as soon as the experience loads.

Intensity

Range

Falloff

Spot Angle

Light Colour

Colour Preview

In the top left corner of the window is a solid bar of colour which will display a preview of the colour and will update in real-time as you adjust it.

Colour Code

To the right of the Colour Preview is a field with a hash (#) and a string of letters and numbers referred to as a Hex Code. The Hex Code represents the colour displayed in the Colour Preview and can be copied and pasted into other Light Behaviours to achieve the same result.

Colour Selecter

Below the Colour Preview is a large square with a crosshair in it.Clicking on an area within the square, or clicking and dragging the mouse within the square, will move the crosshair and change the colour preview to the colour in that location.The colours displayed within the square can be adjusted using the drop-down list or the presets in the bottom right corner of the window.These options will change which two (2) colour attributes are prioritised when moving the crosshair:HS - Hue and SaturationHV - Hue and VibranceSH - Saturation and HueSV - Saturation and VibranceVH - Vibrance and HueVS - Vibrance and Saturation

Red, Green, Blue

The Red, Green and Blue sliders, commonly referred to as RGB, can be individually adjusted to change how much of each primary colour is present in the light.

Hue, Saturation, Vibrance

The sliders to the right of the Colour Selecter are labelled H, S, and R and control how much of the colour properties, Hue, Saturation, and Vibrance, are present in the light.

Hue

Saturation

Vibrance

Apply

Make sure to click the ‘Apply’ button once the desired colour has been achieved.Closing the pop-up without clicking ‘Apply’ will result in losing the edits made to the light colour.

Subtractive

Message to Turn On

This field can be used to access existing Messages or to create new ones. When received, this message will turn the Light Behaviour ON.

Message to Turn Off

This field can be used to access existing Messages or to create new ones. When received, this message will turn the Light Behaviour OFF.

Last updated

Logo

Copyright © 2012- 2023 The Sandbox. All Rights Reserved.