Godot Version
4.4.1
Question
I’m trying to get the menucursor to disable itself when it hides, but no matter what solution I try it doesn’t work.
public async void _on_enemy_button_pressed(BaseButton button)
{
GD.Print(“Pressed”);
state = States.Options;
_optionsMenu.ButtonFocus(0);
await ToSignal(GetTree(), "process_frame");
// Hide the cursor and disable interaction
_menuCursor.Hide();
_menuCursor.MouseFilter = MouseFilter.Ignore; // Disable input interaction
_menuCursor.SetProcess(false); // Ensure the cursor is not processed
playerDamaging();
if (_currentEnemyHealth == 0)
{
GetNode<TextureButton>("Enemy/TextureButton").Hide();
await ToSignal(GetTree().CreateTimer(3f), "timeout");
GetTree().ChangeSceneToPacked(World);
}
else
{
enemyTurn();
await ToSignal(GetTree().CreateTimer(3f), "timeout");
// Show the cursor and re-enable interaction
_menuCursor.Show();
_menuCursor.SetProcess(true); // Re-enable the cursor's processing
_menuCursor.MouseFilter = MouseFilter.Pass; // Re-enable input interaction
}
}