Can someone help me with changing the brightness in WorldEnviornment because it keeps on saying: Brightness: Invalid access to property or key ‘environment’ on a base object of type ‘WorldEnvironment’.
@onready var Player = get_node(“/root/Main/Player”) @onready var play = $Play @onready var settings = $Settings @onready var MMCam = $“Main Menu Cam” @onready var SBATM = $“Settings Menu/BackToMenu”
var inSettings = false
func _ready() → void:
SBATM.pressed.connect(backToMenu)
$“Settings Menu/BritghtnessSlider”.drag_started.connect(Brightness)
if Player.get_meta(“InMM”):
var camera_node = Player.get_node(“CharacterBody2D/Camera2D”)
if camera_node:
camera_node.enabled = false
var main_menu_cam = get_node(“Main Menu Cam”)
if main_menu_cam:
main_menu_cam.enabled = true
func _input(event: InputEvent) → void:
if Input.is_action_pressed(“Interact”):
if Player.get_node(“CharacterBody2D”).global_position.distance_to(play.global_position) < 500:
if inSettings == false:
print(“play”)
if Player.get_node(“CharacterBody2D”).global_position.distance_to(settings.global_position) < 500:
if inSettings == false:
inSettings = true
MMCam.global_position = Vector2(4500, 41)
You don’t have anywhere in your script a reference to the instance of the WorldEnvironment Node, which you need in order for this to work.
Similarly to how you created these references:
@onready var Player = get_node("/root/Main/Player")
@onready var play = $Play
@onready var settings = $Settings
@onready var MMCam = $"Main Menu Cam"
@onready var SBATM = $"Settings Menu/BackToMenu"
Sorry for bothering you because I figured out that WorldEnvironment is a totally different Node. I figured out what I needed to do, but thanks for trying to help me.