[SOLVED] Select Entity with Tag Not Working

For some reason selecting by tag isn’t working. When my ray hits an entity with the tag ‘Pickup’ it does not display the log, however, it is hitting the object with the tag. See code…

var hitEntity = result.entity;
console.log('You selected ' + hitEntity.name); //DISPLAYS CORRECTLY

if (hitEntity.tags.has('Pickup'))
        {
            console.log('You selected a pickup'); //DOES NOT DISPLAY
        }

Hi @Grimmy! Can you show the tag on the entity too?

Like this?: https://www.dropbox.com/s/96w3y0763ubmlmh/tags.png?dl=0

No, you can just share an image here.

tags
Okay :slight_smile:

As far I can see the tag is not added yet.

1 Like

Ah. I didn’t hit enter!

Doh!!!

Better…
image

Yes, that should work. :upside_down_face:

1 Like

Thank You!

1 Like