Ray Cast on Text Mesh / Detect Text Mesh using Mouse

Hi,

How to detect a text mesh is being clicked or mouse over? I've tried to include Mesh Collider (plane). And use OnMouseOver() function, but I realize I missed something...

Anyone can explain how ray castting work on text mesh? And sample of it?

Thank you...

1 Answer

1

Use a box collider. OnMouseOver will work fine; you don't need to manually raycast.

It's highly advisable to use primitive colliders where possible. There's no reason to use a mesh collider for this when a box collider would be simpler and better, and less error prone (if the mesh surface is facing away from the direction of the raycast, for example, raycasting will "pass through" the back side of the mesh and not detect anything).