Modify a node (enabling, changing visibility) from other scene?

Godot Version

4.3

Question

Is there any way to modify a node from another scene? I am working on a mario clone and the player has two CollisionShape2ds (one for big and one for small) and two animated sprite2ds (for big and for small) since you start small, the big animated sprite’s visibility if off (with the little eye thing in scene tree) and the collision shape is disabled and visibility is also off, In the mushroom script, i need to access these nodes to enable them and their visibilities and also disable the small ones, but i dont know how to do that from a different scene.

pls help. Thank you for reading

You should use signals for that, here’s a handy article explaining how signals work:

Your player should be of type CharacterBody2D

Your mushrooms should be of type Area2D

And you can make use of the Area2D.body_entered() signal to catch the moment when your player enters the mushroom’s Area2D and execute the code on the body parameter that is provided by the signal.