if (this.context.input.getPointerDown(0)) {
var arr = this.context.physics.raycast();
if (arr.length > 0) {
console.log(arr[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](https://discord.com/channels/717429793926283276/1032976885094809700)
*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!