- Home /
Question by
THEpancakes · Oct 28, 2012 at 05:25 PM ·
collisionguitexturemouseposition
Collision between GUI Texture and Object
Hi,
I'm using this code to get a GUI Texture to follow my cursor:
var player : Texture2D;
function OnGUI() {
var mousePos : Vector3 = Input.mousePosition;
GUI.Label(Rect(mousePos.x, Screen.height-mousePos.y, player.width, player.height), player);
}
Now how could I detect collisions between that GUI texture, and an object that is in the scene? (I can't use OnMouseOver because the GUI texture that is being projected is much larger than my actual cursor)
Thanks in advance. :)
Comment
Your answer
Follow this Question
Related Questions
Strange collision problem with block and terrain 1 Answer
GuiTexture as crosshair as scroll over to activate things 1 Answer
Space ship UI, multiple pointer that follow individual targets. 1 Answer
Question about pop up boxes during the game 0 Answers
How to find out what is the closest point on a object? 0 Answers