Tagged zones

Hello all,
I want to make areas that are invisible entities and the player could tell when its inside of it or outside of the zone, probably using tags. I don’t think this is possible with collisions or triggers because that fire once, and I don’t think oncollisionEnd or whatever the trigger counterpart is would work because they arent specific to what tag.

I am grateful for any help you can give

Hi @Codeknight999!

I think you can use trigger entities for this.

You need to use the triggerenter event to detect if the entity is inside and triggerleave to know when the entity is not inside anymore.

You can check if the entity has a specific tag as well.

// check if entity has a specific tag
if (entity.tags.has('Your tag')) {
    // your code
}

Hi and thanks @Albertos !
What components do I need to get this to work?

For a trigger entity you need a collision component only.

Thanks!