Search Unity

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. Application.LoadLevel(2);
    26. Debug.Log("Hello");
    27. }
     
    Last edited: Feb 12, 2014
    Cawas likes this.
  2. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    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.