On my current project I use OnMouseUp() as a raycast to get a go, like this:
public virtual void OnMouseUp() {
if (Utils.IsPointerOverUIObject()) {
return;
}
else {
this.ActivateRelatedUI();
}
}
It’s working at runtime but not after a build on pc. I made some tests and it seems that a click’s “raycast” has a limited lenght, as I need to be close enough to a go to be able to click on it. Is it possible to make it infinite like a typical raycast? Is it better to use only raycasts?
I know OnMouseDown is only called when you press the Mouse Down over a GUI Element or a collider. I believe OnMouseUp is then called wherever you release the mouse button. However, if you don’t trigger the initial OnMouseDown ( you pressed the mouse when it wasn’t on a GUI Element or a collider) , then I don’t believe OnMouseUp is called.
You can use IPointerDown and IPointerUp interfaces to get OnPoInterUp callbacks. Or you can check Input.GetMouseButtonUp in Update function to get the frame that the mouse is clicked up.
hi i tried onmouseup and it doesn’t do any thing i don’t know if its a rendering issue or some thing so the i tried on mouse resale but it doesn’t do anything either it just keeps the bird the same colour
Please don’t necro old posts for what you assume to be the same problem. Please just create your own thread with your own details. You don’t provide any detail here for anyone to help you.