Skip to reading
GDScript Programming & Godot

SetFlashlightMode()

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page

Enable / Disable Flashlight Mode

Enable or disable the flashlight-style visibility mask and adjust its strength, radius and shape.

Source table from SetFlashlightMode(), page 158
Option key / fieldMeaning and inputDefault
Flashlight Enabled enabledExplicit on/off state for the feature or response.true
Light Strength strengthNumber; decimals allowed. Range: 0.0 to 8.0.1.0
Light Radius radiusNumber; decimals allowed. Range: 8.0 to 4096.0.180.0
Light Shape shapeChoose: circle, spherical, square, rectangle, triangle."circle"

Timing. Waits for the runtime routine to return; no further completion wait is promised by this schema.

Code example
await SetFlashlightMode({"enabled": true, "strength": 1.0, "radius": 180.0})

In use. Use a circular mask for a dark inspection scene. Radius is a screen-oriented value in this feature; do not confuse it with an OmniLight3D range. This is not a replacement for a physical light attached to a character's hand.

Page 158 of 378Permalink
Go to page