|
Is there any way to turn a game object into a clickable button? I'd like to be able to make buttons without using unitygui.
(comments are locked)
|
|
http://answers.unity3d.com/questions/143480/raycasthit-explanation-wanted.html see this answer you will get idea about ray cast hit make the camera as Main Camera
(comments are locked)
|

Yes, you can use Collider.raycast along with mouse screen coordinates to find out if the player has clicked a given object. However, implementing this kind of thing is much more difficult than using UnityGUI, so only do it if you really have to.
OnMouseDown(){ do this; do that; } attached to some game object makes it clickable, but doesn't turn it into a button.
try to use ray cast hit