The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

0 votes

Hi. I am having some troubles with getting a signal to connect.

I want to preface by saying I am aware that the naming convention of "sniper.png 22" is not good; I am also aware that I am connecting 'coinpickup' and 'weaponpickup' to the same 'update_score' method. I am only using it for testing purposes.

My problem currently is that when I walk over a weapon it should emit a signal called 'weaponpickup'. This should then connect to 'updatescore' when I walk over it. However it does not. This same procedure works with 'coinpickup'. At first I believed that when my character walked over a weapon it never detected any signal, however when I swapped out 'weaponpickup' for 'coin_pickup' in both the emitting and receiving side under 'sniper1.png 22' it worked just as intended. Below are some pictures to further explain my issue. Please let me know if you have any ideas as to why this is not working.

connecting
emit
update_score in HUD

Godot version Godot v3.3-stable
in Engine by (18 points)

signal is emitted and connected in the same moment ??
Or when are signals connected ?

Yeah it's hard to see the problem without the rest of the code. However, if moving over it is not triggering the signal, it could be somewhere else in your logic, like the movement itself. You could also be on a different layer than these objects. It's hard to tell without more code.

thank you for the reply! I found the issue. I simply forgot to type "signal weapon_pickup" at the top of my pickup script lol.

Please log in or register to answer this question.

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.