On a 2D layout, having a fixed in place button-like GameObject that has a script with the OnMouseDown and OnMouseUp function: touching that and moving the finger away and releasing, can that OnMouseUp get that corresponding finger release position on screen?
The catch is: its a multiplayer, many other fingers on screen!
You shouldn't be using the
OnMouseDownandOnMouseUpcallback functions for this because that would require that you get the touch position withInput.mousePositionon the desktops andInput.toucheson mobile devices.This should be done with the
OnPointerDownandOnPointerUpfunctions which gives youPointerEventDataas parameter. You can access the pointer position there withPointerEventData.position. It will work on both mobile and desktop devices without having to write different code for each platform. Note that you must implement theIPointerDownHandlerandIPointerUpHandlerinterfaces in order for these functions to be called.If you run into issues with it, you can always visit the troubleshooting section on this post to see why.