|
OnMouseDown() will tell me when an object is clicked. Is there a way to know which face of a cube was touched?
(comments are locked)
|
|
You'll need to cast a ray from the mouse position into the scene, and examine the RaycastHit result to check which triangle was hit. There are two triangles on each side of a cube, so you'll need to check for both triangles for each side. Eg:
You'll need to work out which indices relate to which sides, and group them accordingly in to "if" statements, like this:
0 and 1 might not be the top, I haven't tested this myself - this is just for illustration! Good luck!
(comments are locked)
|
