OnMouseUp not working

I've coded a basic toolbox and when I click on an object it should do something. Now the problem I have is that the OnMouseUp doesn't work. I've tested it with OnMouseEnter and print some random line, but that doesn't do anything either.

It's a 2D game, so at first I thought it might be the camera, so I moved it a bit closer to the objects and that seemed to work for a few times. But now again, nothing responds on click.

Here's the code I'm currently using, I haven't changed anything from the point that it did work.

It does have a sphere collider and a rigidbody that is Kineamatic and doesn't use gravity.


` using UnityEngine; using System.Collections;

public class BlackHoleScript : MonoBehaviour {

public ToolBox m_ToolBox = null;
public Transform Paper;
public AudioClip SoundClip = null;

void Start() {
    gameObject.AddComponent<AudioSource>();
    audio.clip = SoundClip;
    audio.loop = true;
    audio.rolloffMode = AudioRolloffMode.Linear;
    audio.maxDistance = 10.0F;
    audio.Play();
}

void Update() {
    if (audio.volume == 0) audio.Stop();
}

void OnMouseUp() {
    if (m_ToolBox.GetActiveTool() == "Paper") {
        iTween.ValueTo(gameObject, iTween.Hash("from",audio.volume, "to",0.0F, "time", 1.0F, "onUpdate","VolumeTo"));

        m_ToolBox.SetActiveTool("Nothing");
        m_ToolBox.SetPaper(m_ToolBox.GetPaper() - 1);
        m_ToolBox.SetToolBoxActive(false);
        Destroy(collider);

        Vector3 position = new Vector3(transform.position.x, transform.position.y, 0.3F);
        Instantiate(Paper, position, transform.rotation);
    }
}

void VolumeTo(float value){
    audio.volume = value;
}

} `

You need a collider on the object, or else it has to be a GUI element (GUIText/GUITexture).

Ok, apparently it was because the toolbox I added came directly from a prefab and not the object in my scene. That fixed it and it now works fine.