Animation players are somehow linked even through different nodes and instances?

Godot Version

v4.3.stable.mono.official [77dcf97d8]

Question

I noticed a very strange, and admittedly rather annoying behaviour today while making an inventory system for my game.
I have an inventory slot scene that looks like this:

And each one of these contains an animation player that animates the PanelContainer within, to show which slot is currently selected.
Here’s the core inside the InventorySlotUI node:

using Godot;
using System;
using GameName.Scripts.InventorySystem.Core;
using GameName.Scripts.InventorySystem.Events;

namespace GameName.Scenes.Inventory.Scripts;

public partial class InventorySlotUi : TextureRect
{
	[Export] private ItemData _data;
	private TextureRect _itemIcon;
	private Label _itemName;
	[Export] private AnimationPlayer _animationPlayer;

	public event EventHandler<InventorySlotClickedEventArgs> Clicked;
	
	public int SlotIndex { get; set; }

	public override void _Ready()
	{
		base._Ready();

		_itemIcon = GetNode<TextureRect>("MarginContainer/ItemIcon");
		_itemName = GetNode<Label>("MarginContainer/ItemName");

		if (_data is not null)
		{
			UpdateSlot(_data);
		}
	}

	public void UpdateSlot(ItemData item)
	{
		_data = item;
		if (_data is null)
		{
			_itemIcon.Hide();
			_itemName.Hide();
		}
		else
		{
			_itemIcon.Show();
			_itemIcon.Texture = _data.Icon;
			_itemName.Show();
			_itemName.Text = _data.ItemName;
		}
	}

	public void Select()
	{
		GD.Print($"Selected with item data: {(_data is null ? "no item" : _data.ItemName)}");
		_animationPlayer.Play("Selected");
	}

	public void Unselect()
	{
		_animationPlayer.Play("Unselected");
	}

	private void SlotSelected()
	{
		Clicked?.Invoke(this, new InventorySlotClickedEventArgs(_data, false));
	}

	private void SlotRightClicked()
	{
		Clicked?.Invoke(this, new InventorySlotClickedEventArgs(_data, true));
	}

	public override void _GuiInput(InputEvent @event)
	{
		base._GuiInput(@event);
		if (@event is not InputEventMouseButton mouseEvent)
		{
			return;
		}
		
		if (mouseEvent.Pressed && mouseEvent.ButtonIndex == MouseButton.Left)
		{
			SlotSelected();
		}

		if (mouseEvent.Pressed && mouseEvent.ButtonIndex == MouseButton.Right)
		{
			SlotRightClicked();
		}
	}
}

And here’s the scene that holds these instances:

And the code for the Control node near the top:

using Godot;
using GameName.Scripts.InventorySystem.Core;
using GameName.Scripts.InventorySystem.Events;

namespace GameName.Scenes.Inventory.Scripts;

public partial class InventoryControlNode : Control
{
	private CanvasLayer _canvas;
	private TextureRect _background;
	private Timer _timer;
	
	private ItemData _currentlySelectedItem;
	private InventorySlotUi _currentlySelectedSlot;
	
	[Export] private InventorySlotUi[] _slots;
	[Export] private RichTextLabel _itemDescription;
	[Export] private Button _dropItemButton;
	[Export] private Button _useItemButton;

	public override void _Ready()
	{
		base._Ready();

		_canvas = GetParent<CanvasLayer>();
		_canvas.Visible = false;

		_background = GetNode<TextureRect>("InventoryBackgroundFrame");

		foreach (InventorySlotUi slot in _slots)
		{
			slot.Clicked += SlotOnClicked;
		}
	}

	public override void _ExitTree()
	{
		foreach (InventorySlotUi slot in _slots)
		{
			slot.Clicked -= SlotOnClicked;
		}
		base._ExitTree();
	}

	private void SlotOnClicked(object sender, InventorySlotClickedEventArgs e)
	{
		InventorySlotUi clickedSlot = sender as InventorySlotUi;
		
		if (_currentlySelectedSlot == clickedSlot)
		{
			return;
		}
        
		_currentlySelectedSlot?.Unselect();
		_currentlySelectedSlot = clickedSlot;
		_currentlySelectedSlot?.Select();
		_currentlySelectedItem = e.ItemClicked;
    
		RefreshDescription();
	}


	private void RefreshDescription()
	{
		if (_currentlySelectedItem is null)
		{
			_itemDescription.Text = "[center]No item selected";
			return;
		}
		
		_itemDescription.Text = "[center]" + _currentlySelectedItem.Description;
	}
}

Now here’s my problem:
All of this works great, and even when I print out something in the Select function, I get back exactly what I would expect, and ONLY once. Only that specific slot’s Select function gets executed. Despite this, EVERY single Animation Player for EVERY slot is somehow invoked and plays the animations I made. This is very much not what I want. If this is expected behaviour, how can I get around it? I did not Duplicate the Slot nodes also, I suspected that might be the issue at first, and simply put them in one by one manually, but still, all the AnimationPlayer nodes inside each slot play at once for no reason what so ever.

PS: Setting “LocalToScene” on the StyleBoxFlat for the Panel did not help, they all still get animated at once.

This is weird. What are you animating? Is it by chance some resource properties?
And did you assign the correct animation player to the exported property?

I was animating the PanelContainers StyleBox properties. There’s only a single animation player in those scenes, and yea, it’s correctly connected up. Same thing happens if I get the animation player using GetNode.

And yes, I tried setting the StyleBox resource to be local, same thing happens.

What happens if you animate something else, i.e., some non-resource properties? Are they still animated at the same time?

I will check later on, unfortunately our deadline is very tight so for now I simply disabled and removed this feature.