Selecting Multiple Tags

Hello,

I want to find out if there is a way to select multiple tags within the Entity window. I am more familiar with c# and working in Unity. I am new to the Play Canvas engine and Java Script. I know there is a way to create a tag array with dropdown selectors using c# and Unity. Is there anyway that this can be accomplished in Play Canvas? Currently the tags are being manually entered into the tag type window.

Tag Selector

PlayCanvas uses literal string list for tags for entities so you won’t get a dropdown list (beware of typos)

Type each tag one at a time and press enter (see below) to have more than one tag.

To make this a bit easier, you can multiselect entities and edit all their tags at once.

Hello Yaustar,

Thank you for your reply. I was more looking for a way to code in functionality that modifies the Entity window. I have a Unity example linked below for what I am referring to. Is this a possibility with Play Canvas?

Thank you again!

I’m afraid Editor scripting is not officially available yet. We are looking to make this possible this year.

It is possible to do (the Editor code in the browser is not minified) and have had some members create their own chrome extensions to do so but PlayCanvas does provide any support if you do go down this route.

Just read the article, if you are okay using a script for tags as they are doing in the article, you can do something similar and use script attribute enums in an array.

var Test = pc.createScript('test');
Test.attributes.add('tags', {
    type: 'string',
    default: [],
    enum: [
        { 'tag1': 'tag1' },
        { 'tag2': 'tag2' },
        { 'tag3': 'tag3' }
    ],
    array: true
});

More information on Script Attributes here: https://developer.playcanvas.com/en/api/pc.ScriptAttributes.html

That is interesting, thanks for the help! I may give this a try. :slight_smile: