Update tags with code

Hi can we update the tags with the help ofscript?

Hi @regeme, yes!

You can add a single tag like this:

this.entity.tags.add('my-tag');

Or even multiple tags at the same time:

this.entity.tags.add('tag-1', 'tag-2');

Check the API here:

https://developer.playcanvas.com/api/pc.Tags.html#add

2 Likes