Reputation: 581
This is a further question of this: how to make the new input handlers (IPointerDownHandler, and so on) work on non-UI GameObject?
I did the instructions as the accepted answer said, and it worked well. but today a new problem appears. when changing the GameObject's Box Collider commponent to Polygon Collider 2D or Box Collider 2D, it does not response clicks.
Polygon Collider 2D is necessary for path finding in my game.
Upvotes: 0
Views: 234
Reputation: 41
You would find a PhysicRaycaster Component on your MainCamera, it is used by 3d gameObject. To make effect on 2d gameObjects, you just need add a Physic2dRaycaster Component on you Camera. see this link for detail: solution
Upvotes: 0
Reputation: 13337
Since you're using components with 2d physics, you should replace the raycaster you have (probably PhysicsRaycaster) with Physics2DRaycaster.
Upvotes: 2