Open Noreir opened 4 years ago
Hi, to solve the first problem if I understood correct, if your touch goes through UI and creates gestures you could try add EventSystem.current.IsPointerOverGameObject to GestureRecognizer itself to this method:
TryCreateOneFingerGestureOnTouchBegan(Func<Touch, T> createGestureFunction)
It helps to block all one finger gestures if it starts from any UI object. For me this code works well
protected internal void TryCreateOneFingerGestureOnTouchBegan(
Func<Touch, T> createGestureFunction)
{
for (int i = 0; i < Input.touches.Length; i++)
{
Touch touch = Input.touches[i];
if (touch.phase == TouchPhase.Began
&& !GestureTouchesUtility.IsFingerIdRetained(touch.fingerId)
&& !GestureTouchesUtility.IsTouchOffScreenEdge(touch)
&& !EventSystem.current.IsPointerOverGameObject(touch.fingerId)) // this check
{
T gesture = createGestureFunction(touch);
gesture.onStart += OnStart;
gesture.onFinished += OnFinished;
m_Gestures.Add(gesture);
}
}
}
Also if you need to have some UI panels with working gestures through them you could try to change "Block Raycasts" bool field in CanvasGroup component or "Raycast Target" bool field in Image component.
Hi, I'm trying to develop an App like the one from Ikea, the idea is to select some items from a menu and tap where u want to place it, I used the Example Scene from ObjectManipulation as starting point. The first issue is that the only canvas I can use is Screen Space-Overlay, if I try using any different type it just won't work, the Screen Space (because it's attached to the camera and doesn't follow as it should) and in Screen Space - Camera becomes 1D at run, I don't know why but it just folds up himself.
So the 1st problem is that I can't stop the Frame.Raycast from PawnManipulator. I've tried using EventSystem.current.IsPointerOverGameObject with a return but it doesn't read the touch because it's reading the gestures, and if I try to control it with touchCount and .phase, then it doesn't pass through and the only thing working is the canvas. So how can I stop the Raycast at UI?
By the way, the tour of object manipulation at ARCore developer is obsolete.
Another question is that I don't find any Gesture control, is it in the ManipulationSystem.cs Update? I mean: are those calls to the specific gestures the ones in which the logic edition should be done?
Thanks a lot.
VERSIONS USED