EmoteWheel.cs

A small component that manages a current emote icon and automatically clears it after a duration. It exposes CurrentEmote and EmoteDuration, PlayEmote sets the emote and a timer, and OnUpdate clears the emote when the time exceeds the duration.

using Sandbox;

public sealed class EmoteWheel : Component
{
	[Property] public string CurrentEmote { get; private set; } = "";
	[Property] public float EmoteDuration { get; set; } = 2.5f;

	private TimeSince _emoteTimer;

	public void PlayEmote( string emoteIcon )
	{
		CurrentEmote = emoteIcon;
		_emoteTimer = 0;
	}

	protected override void OnUpdate()
	{
		if ( !string.IsNullOrEmpty( CurrentEmote ) && _emoteTimer > EmoteDuration )
		{
			CurrentEmote = "";
		}
	}
}