Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

OnMouseOver

Discussion in 'Scripting' started by RockHound, Apr 29, 2006.

  1. RockHound

    RockHound

    Joined:
    Apr 14, 2006
    Posts:
    132
    I am attempting to create a GUI with multiple GUITexture's.

    I have an empty GameObject with a GUITexture. The GameObject Position is (.1, .9, 0) to place it in the upper left of the screen, and its scale is (.1, .1, .1). I attached this script component to the GameObject:
    Code (csharp):
    1.  
    2. function OnMouseOver()
    3. {
    4.     Debug.Log("over");
    5. }
    6.  
    When I start the game, it seems that OnMouseOver is called immediately rather than when I move the mouse over the object. Why would this happen?

    Thanks.