I have no clue why this wont work

help me

extends Sprite2D

var office2 = preload( "res://office 2.png" ) # Use quotes around the path

var left_light # This needs to be assigned in the editor or in _ready()

func _ready():

# Example of assigning left_light if it's a sibling node named "LeftLight"

left_light = get_node("../LeftLight")

func _process(delta: float) -> void:

if left_light and left_light.isleftlightshining:

self.texture = office2

im trying to get it to change the texture if isleftlightshining (which is in a global script) and it wont work, as in it just stays as the original texture.

Posted Jan 3, 2026, 7:55 PM UTC

33

Comments aren't archived yet

This post had 3 comments on Reddit. Comments for this period haven't been loaded into the archive yet.