← Back to all addons

Status Effect Timers

Posted by SvanDark on Mar 28, 2026 at 11:23 AM

Gameplay3.0 Verified
🔥 3

With this addon, your buffs/debuffs will now show a timer on when they’re expiring!

  1. Start by going into the ITemporalEffect.cs and add these 2 properties:
public float remainingDuration { get; }
public bool hasFiniteDuration { get; }
  1. Go into the ATemporalEffect.cs script and add these two properties:
public float remainingDuration => m_temporalData.remainingDuration;
public bool hasFiniteDuration => !float.IsPositiveInfinity(m_temporalData.remainingDuration);

and also make sure Update() only counts down finite effects

public void Update()
{
    Debug.Assert(m_effectData.initialized, "Effect must be initialized before updating.");

    if (!float.IsPositiveInfinity(m_temporalData.remainingDuration))
    {
        m_temporalData.remainingDuration = math.max(0.0f, m_temporalData.remainingDuration - Time.deltaTime);
    }

    OnUpdate();
}
  1. Go into the UIEffectIcon script and add these two properties:
public Image iconImage => m_icon;
public RectTransform iconRectTransform => m_icon != null ? m_icon.rectTransform : transform as RectTransform;
  1. Import the new script into your runtime folder that i have attached to this message

  2. Go into your UIHudEffectBar script and add this inside OnTemporalEffectAdded(ITemporalEffect effect)

var timer = effectIcon.GetComponent<UIEffectIconDurationTimer_TD>();
if (timer != null)
{
    timer.Unbind();
}

effectIcon.Hide();

DONE! no unity setup is needed

If you wanna modify the text thats counting down, change these values inside the UIEffectIconDurationTimer_TD script

[SerializeField] private float m_verticalOffset = 6f;
[SerializeField] private float m_textHeight = 16f;
[SerializeField] private float m_widthPadding = 8f;
[SerializeField] private float m_fallbackWidth = 64f;
[SerializeField] private float m_fallbackFontSize = 12f;
[SerializeField] private float m_referenceFontScale = 0.75f;

💬 Comments (1)

Gyvr Mar 28, 2026 at 02:10 PM
Amazing!! Looks great, thank you so much for sharing 🙏

Want to continue the conversation?