+1 vote

I think this is not in the docs yet. So, how can I write this line get_node("/root/main/car").connect("armor_changed", self, "_on_armor_changed") with the $?

I have tried this way$root/main/car.connect("armor_changed", self, "_on_armor_changed")but is giving me an error.

note: car is a subnode of the main node.


in Engine by (181 points)

1 Answer

+4 votes

Use ""

$"/root/main/car".connect("armorchanged", self, "onarmorchanged")

by (2,298 points)

Thanks man. The docs needs an update about this.

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 Frequently asked questions and 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 [email protected] with your username.