+1 vote

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.

Godot version 3.2.3
in Engine by (15 points)

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

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

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

1 Answer

0 votes

try to restart the Editor.

by (254 points)

Believe me, I've done that a lot.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.