Can't change texture of node.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Igodotproblems

I have a player node and a door node. Im connecting a bodyentered signal from the door node to the player node. I 'm having trouble accessing $Door in the player script to change the door’s texture when the player enters the door’s area2d.enter image description here

I should also mention that I made my Door.tscn global so I could access it.

How did you make it global? Did you add it to the AutoLoader?

demwilson | 2020-12-23 23:03

yup I made the door.tscn a global and made the variables that change the door texture global as you can see “Global.dooropen” . I just don’t know how to access a node and change its texture in a different node. Not too sure how get_node works

Igodotproblems | 2020-12-23 23:06

…try $"/root/Door/Sprite".texture instead? What error message are you getting?

exuin | 2020-12-23 23:31

:bust_in_silhouette: Reply From: Bot7

try to restart the Editor.

Believe me, I’ve done that a lot.

Igodotproblems | 2020-12-23 22:46