OnMouseUp () method does not work on unity4

2

Hello! I'm new to Unity and I can not do the OnMouseUp () method; work

using UnityEngine;
using System.Collections;
 public class touch : MonoBehaviour {

    void OnMouseUp() {

        Debug.Log("Drag ended!");
    }}

I've already assigned the script to the object. I click on it and nothing happens. Can anyone explain me why it does not work?

    
asked by anonymous 06.08.2015 / 02:27

1 answer

0

According to the Unity documentation, for the OnMouseUp event to work, it must be in an object that contains a Collider or GUIElement .

For more information, see the documentation: link

    
30.03.2016 / 13:44