0 votes

Hey All,

Quick question. I have only been using signals as one time emits or at least one call=one emit. is it ok to use them in the physicsprocess/_process function? IE emit them every frame? (performance issues/bugs?)

My specific implementation is to communicate a player's stamina to the HUD as it regens. is there anything wrong with using signals or should I just use a getparent().getnode() chain?

in Engine by (577 points)

1 Answer

+1 vote
Best answer

That ultimately depends on your definition of "okay", but generally speaking: yes. Choosing between calling a method and emitting (and connecting) to a signal shouldn't matter much in terms of performance. General rule of thumb: do not try to solve problems that you have yet to encounter! I think the advice given here is usually sound: "call down, signal up". It keeps scenes self-contained, which makes it easy to transfer them over to other projects or make changes in the tree structure.

by (10,327 points)
selected by
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.