Onmouseup() method does not work in unity4

Asked

Viewed 57 times

2

Hello! I’m new to Unity and I can’t make 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 to me why it doesn’t work?

  • 1

    Your object has a Collider or a Guielement?

  • Colleague @lazyFox most likely got the reason right. See on documentation of the method, where it clearly says: "This Event is sent to all scripts Attached to the Collider or Guielement."

  • By the way, @lazyFox, you could already provide an answer based on your placement. :)

  • Hello friends! thanks for the tips I found a tutorial here https://www.youtube.com/watch?v=52U-eCAeGSo

  • Hello Emerson. Have you been able to solve your problem with this tutorial? If yes, please create an answer yourself explaining (don’t just point out the tutorial!) what the problem was and how you solved it. This can help other people in the future, and justifies keeping your question here on the site. :)

1 answer

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.