Is there a way to find the tag of an object found in a raycast?

        if (this.context.input.getPointerDown(0)) {
            var arr = this.context.physics.raycast();
            if (arr.length > 0) {

I am using this to grab objects in the scene, I was wondering if I can get the tag of the object? and if not, what would be the best way to determine you got the type of object you want? I would be reluctant to go via names

[Original Post on Discord](

*by user 95852307077406720*

Yes you can - you can use arr[0].object.userData?.tag

What kind of object would you want?

You can also use methods like arr[0].object.getComponent(Renderer) for example - with whatever component type you want

Awesome thank you!

by user 95852307077406720

Youre welcome! :slightly_smiling_face: