← Back to all addons

On Player Stay Command Trigger

Posted by MrMystery on Feb 5, 2026 at 4:25 PM

GameplayFeature3.0 Verified
❤️ 4 🔥 3 ❄️ 3

Okay this isn’t much of an add-on, but I’ve had a couple people ask me how to make like area effect damaging from the environment. This can be done using the Command Trigger, but it needs a little help:

Purpose: Say you want a healing zone, or mana replenishing zone or environment / spring water, you run into the water, you start healing. Or run across lava, you start burning, etc… And if you continue to stand there… you keep healing or burning, etc…

M2D originally only had Enter/Exit, so when you entered you could trigger something, and exit, but not a super clean way (unless I’m mistaken!!!) to just continually have an effect run.

So, 2 lines of simple code:

In CommandTrigger.cs

Add:

public enum EActivationEvent
{
OnPlayerStayTrigger,
}

Then at the bottom near OnMovable and OnInteract:

private void OnTriggerStay2D(Collider2D collider) => AttemptExecution(EActivationEvent.OnPlayerStayTrigger, collider.gameObject);

You can then setup a Temporal Heal/Dmg effect, or whatever, that continues to pop on the player, however you want to wire it up. Example shown of how I setup my mana circle. Just drop a 2D collider + Command Trigger on a gameobject, and good to go.

💬 Comments (3)

Zuko Feb 05, 2026 at 06:47 PM
very nice
Zuko Feb 06, 2026 at 03:14 PM
just a quick heads up to this, after installing the package, i noticed that all stuff that deals with triggers in my game had become stay by default, and i needed to manually change it back to the correct option
Zuko Feb 06, 2026 at 03:15 PM
still a great add on, just a minor heads up for those who have a lot of triggers

Want to continue the conversation?