- Home /
Pointer Event Data does not use the PhysicsRayCaster event mask.
I'm dealing with an isometric click-to-move game where I have multiple floors. I have colliders set up to trigger culling masks when the player moves to another floor and this works perfectly. Each roof is culled from the camera as the player moves up or down by using Layers Roof1, Roof2, etc.
I've also put an eventmask on the PhysicsRaycaster on the camera, but this shows very erratic behavior. The PointerData worldposition when I click on the ground I use to trigger an 'ongroundclick' event is often the one on the higher roof, which does not show on the current camera and is hidden from the raycaster by the mask.
Any ideas? Is the PointerData from the built-in event trigger ignoring the eventmask I set up for the PhysicsRaycaster? Could the NavMesh have something to do with it?
I've been trying to get this to work for days now, and I've tried everything. If I limit the draw distance of my camera to the exact floor height it works better, but it's still erratic. I've also tried multiple camera's, one for rendering and one for raycasting that was optimized for draw distance, but even though that works a little bit better, it's still not perfect and really slow.
Any idea what causes the pointerdata to register objects that are masked in the raycaster?
Answer by karl_jones · Jul 10, 2018 at 02:42 PM
There are many things that can be going wrong here. Do you have an example project you can share?
Thank you for the reply. It took me a while to set up an example project, but while I was working on that, I realised that the Nav$$anonymous$$esh is always raycasted on the Default layer no matter what you do to the objects in the scene. I stopped using the default layer in my culling system and everything works fine now.
Your answer
