Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

onMouseUp not working

Discussion in 'Editor & General Support' started by Meeseeks, Feb 12, 2014.

  1. Meeseeks

    Meeseeks

    Joined:
    Feb 12, 2014
    Posts:
    2
    I have no idea why this isnt working. The colliders work with both onMouseOver and onMouseExit. this was just a group of boxes as a character select screen.


    Code (csharp):
    1. static var characterSelected: int;
    2.  
    3. function Start () {
    4.  
    5. }
    6.  
    7. function Update () {
    8.  
    9. }
    10. function OnMouseOver()
    11. {
    12. GetComponent("Halo").enabled = true;
    13. }
    14. function OnMouseExit()
    15. {
    16. GetComponent("Halo").enabled = false;
    17. }
    18.  
    19. function onMouseUp()
    20. {
    21. if(this.name=="1")
    22. {
    23. characterSelected=1;
    24. }
    25. Debug.Log("Hello");
    26. }
     
    Last edited: Feb 12, 2014
    Cawas likes this.
  2. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,668
    Cawas likes this.
  3. Meeseeks

    Meeseeks

    Joined:
    Feb 12, 2014
    Posts:
    2
    I figured it would be something simple, but not this simple. Thanks Dantus, I shall now slink away in shame.