Using a signal notified method as tick function?

Godot Version

4.6.2.stable

Question

Piggy backing off of a question I had last week, in which I found the solution, I’m now wondering if this is not a great thing to be doing. The gist of it is that I’m working on a procedural locomotion system that requires retrieving bone transforms after animation is applied, then again after IK is applied.

The mixer_applied() signal notifies when animations are applied.
modification_processed() notifies when a skeleton modifier (in this case leg IK) has been applied.

A simplified version of what I have:

func _ready(): -> void:
	animation_player.mixer_applied.connect(_on_animation_player_mixer_applied)
	two_bone_ik.modification_processed.connect(_on_two_bone_ik_modification_processed)


func _on_animation_player_mixer_applied() -> void:
	_update_body_offset()
	_update_ik_target(left_target)
	_update_ik_target(right_target)


func _on_two_bone_ik_modification_processed() -> void:
	_update_foot_orientation(left_foot)
	_update_foot_orientation(right_foot)

And this does work, and even the Godot team’s own example of the skeleton modifier system does something similar. However I’ve been reading that signals are more for one off events, and not so much for ticking every frame. I also require get_physics_process_delta_time() in some of those functions, which just seems like another hint that this isn’t the way to go.

Thoughts?

Signals are just function calls. Nothing wrong with handling a signal that emits every frame if you need to.

Ahh fair enough. The way I’ve seen it discussed by others made it seem like they have some hidden overhead that would be compounded as my procedural system grows. I’ll stay the course, then. Thanks.

There’s nothing “magical” about signals. The system just stores a list of references to handler functions and calls them in succession when the signal is emitted. It’s as simple as that. When you make a signal connection, you just add one more function reference to that list. The whole signal system is extremely low overhead, so no worries there.