Skip to content

wait for signal based on parameters #800

@bitwes

Description

@bitwes

Versions

What versions of Godot do you want to use this feature in?
latest

The Feature

Add the ability to wait for a signal to be emitted with specified parameter values. This should probably be done with another method instead of complicating the argument list for wait_for_signal.

Example:

func test_switches_to_idle_state_after_attack():
    var player = add_child_autofree(Player.new())
    player.attack()
    # wait up to 5 seconds for the state machine to change state to idle.
    await wait_for_signal_with_parameters(player.state_machine.state_changed, ['idle'], 5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions