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?
Your object has a Collider or a Guielement?
– lazyFox
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."
– Luiz Vieira
By the way, @lazyFox, you could already provide an answer based on your placement. :)
– Luiz Vieira
Hello friends! thanks for the tips I found a tutorial here https://www.youtube.com/watch?v=52U-eCAeGSo
– Emerson Barcellos
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. :)
– Luiz Vieira