Josephbrad1234
Josephbrad1234

Reputation: 11

Signal is not connected - Godot

I am trying to implement a brightness slider into my game but am running into problems connecting the signal.

A global function is called, which should emit a signal.

extends Node

signal change_brightness(val)

func update_brightness(value):
    emit_signal("change_brightness", value)
    print(value)

The function successfully prints the value so the error is not to do with this. The signal is connected to the below script.

extends WorldEnvironment

func _ready():
    GlobalSettings.connect("change_brightness", self, "_on_brightness_updated")

func _on_brightness_updated(value):
    print('hello')
    environment.adjustment_brightness = value # sets new brightness value 

Hello is not being printed showing the signal is not working.

Thanks

Upvotes: 0

Views: 884

Answers (1)

Josephbrad1234
Josephbrad1234

Reputation: 11

Just figured it out.

The WorldEnvironment Scene was not instanced within the scene.

Knew it would be something silly.

Upvotes: 0

Related Questions