Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it now!
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. 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. 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,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.