Without colliders your physics raycast can not hit anything.
If you want to raycast against threejs meshes then use this.context.physics.raycast (not physics.engine.raycast)
You just add colliders in unity or blender to your scene where you need them (box, sphere, capsule or meshcolliders) and then raycast with this.context.physics.engine?.raycast()
You can not ignore certain colliders right now as you can with unity because raycast layers are not exposed / implemented yet.
When you hit something you can only use the name or the components on the gameObject to figure out if you hit what you wanted but that might not be enough depending on your usecase (not sure what you’re building, maybe you can describe what you need)
(i might be mistaken, i think raycast has a way to filter hits via a callback but im currently on a train, i can check again later for you to give you a more precise answer)
With the non physics raycast (this.context.physics.raycast) you can add RaycastOptions as an argument to ignore e.g. objects on specific layers, e.g. unity’s layer for IgnoreRaycast is ignored by default)
For example. You can check for tags or layers the same way. Or by getting a specific component via e.g. hit.collider.gameObject.getComponent or getComponentInParent
Hi, i’m checking the rayscast and i’m trying to understand the RayCastOptions, could you give an example of his use ? If I want to set the origin point and the vector direction and maybe the length of the raycast.
And for example, this statement hit?.collider.layer is posibble ?
Thank you .