I installed the Prime 31 Touch Kit and its good, and i want to use it to pan my camera and look around. My problem is, when i touch some of the movement buttons(that i put on a canvas), prime 31 detects this. Is there any way that the script can ignore when i touch an element such as a button? I don’t know where else to ask questions about this kit I thought this would be the best place.
Use:
EventSystem.current.IsPointerOverGameObject()
E.g.:
// This is on the camera object, and moves the projection camera up / down based on the pinch
// ONLY if it is not over an object within the EventSystem
private void PinchRecognizer_gestureRecognizedEvent(TKPinchRecognizer obj) {
if (!EventSystem.current.IsPointerOverGameObject()) {
float y = Mathf.Clamp(transform.position.y + (transform.position.y * obj.deltaScale), 5, 15);
transform.position = new Vector3(transform.position.x, y, transform.position.z);
}
}