➑️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

There are two Light Types, Point and Spot, which control the shape and direction of light.

Point Lights

Setting Light Type to Point Light will make the light emit from a central point and radiate in ALL directions as a β€˜sphere’ of light.

Spot Lights

Setting Light Type to Spot Light will make the light emit from a central point and radiate in ONE direction as a β€˜cone’ of light.

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

This variable controls how bright the light is and can be set using values between 1-100.

Range

This variable sets the β€˜distance’ the light will travel and is measured in meters.Both the slider and the field can be used to set the Range to a value between 1 and 20.The values on the slider in meters equal one Block. Keeping this in mind can be useful when setting the desired range.

Falloff

Fall-off defines the gradient in intensity from the centre of the light to the outer edges of the lit area.The values can be set between 0 - 1, where a lower number will produce a softer gradient, and a higher number will produce a harder edge.

Spot Angle

This parameter will only be available if Light Type is set to β€˜Spot’.The Spot Angle defines how β€˜wide’ the cone of light will be and can be adjusted using the slider or manually entering a number between 1 and 90.Setting the Spot Angle to 1 will create a narrow beam of light, while setting the value to 90 will create a broad beam.

Light Colour

Clicking on the colour bar in the Properties Panel will open a pop-up window containing a range of options to modify the colour of the light.

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

Controls the shade of a colour, such as green, purple, yellow or orange.

Saturation

Controls how dulled down or intense colour is.

Vibrance

Controls how bright or dark a colour is.

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

The Subtractive parameter can be toggled to 'TRUE or FALSE, and when it's toggled to 'TRUE', the area that was previously lit will now remove light rather than add it.The Subtractive Light still uses the same variables as the standard light, with a key difference that increasing Intensity will more aggressively remove light within the defined range.When a standard Light and a Subtractive Light overlap, they will blend depending on which Light Behaviour has the greatest Intensity value.

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.