diff --git a/extensions/reviewed/Light3D.json b/extensions/reviewed/Light3D.json index e72ed1c35..63f119640 100644 --- a/extensions/reviewed/Light3D.json +++ b/extensions/reviewed/Light3D.json @@ -10,7 +10,7 @@ "name": "Light3D", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/f237ae4e3b857c556846c7b2c0b132556fd4bcdeff217034b4d9c97dc1aab1d6_lightbulb-on-outline.svg", "shortDescription": "A collection of light object for 3D.", - "version": "1.0.3", + "version": "1.0.4", "description": "A collection of light object for 3D.", "origin": { "identifier": "Light3D", @@ -434,7 +434,9 @@ " * @param value {number}", " */", " setRange(value) {", - " this.pointLight.distance = value;", + " const runtimeScene = this.object.getRuntimeScene();", + " const inverseWorldScale = runtimeScene.getRenderer3DInverseWorldScale ? runtimeScene.getRenderer3DInverseWorldScale() : 1;", + " this.pointLight.distance = value * inverseWorldScale;", " }", "", " /**", diff --git a/scripts/lib/ExtensionsValidatorExceptions.js b/scripts/lib/ExtensionsValidatorExceptions.js index fdf2e733a..46769b943 100644 --- a/scripts/lib/ExtensionsValidatorExceptions.js +++ b/scripts/lib/ExtensionsValidatorExceptions.js @@ -552,6 +552,7 @@ const extensionsAllowedProperties = { '__pointLight3DExtension', 'getScene', '__lightManager', + 'getRenderer3DInverseWorldScale', ], javaScriptObjectAllowedProperties: ['getPrototypeOf'], },