News: Enjoy our Christmas offer 30% off on our latest package Tower Defense Level Kit http://u3d.as/m7h

  • December 13, 2018, 10:45:47 AM

Login with username, password and session length

Author Topic: Swipes do not work with planes  (Read 2102 times)

Offline piginhat

  • Newbie
  • *
  • Posts: 13
Swipes do not work with planes
« on: January 27, 2017, 03:54:02 PM »
I have a series of gestures that all worked, swipe up, down, left, right and a pinch to scale.

I then added a plane with a depth mask that my model stands on and find that only the pinch works now?  None of the swipes work, but if I disable the plane they do?

Help?

Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: Swipes do not work with planes
« Reply #1 on: January 28, 2017, 05:40:04 PM »
Hi,

What do you call "depth mask" in Unity ?

Offline piginhat

  • Newbie
  • *
  • Posts: 13
Re: Swipes do not work with planes
« Reply #2 on: January 28, 2017, 06:59:09 PM »
Hi,

I have a black png image, see black setting image, that is attached to the plane as a material, see material setting image, that has a standard unity depth mask shader, see shader settings image.

This means that when I scale the game object in size the plane masks what ever goes under it.  What is odd is that the pinch gesture works but the other don't?

Mmm, the site wont upload my images?  I will email them to you right now.

Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: Swipes do not work with planes
« Reply #3 on: January 29, 2017, 10:53:16 PM »
Hi,

I think your problem comes from collider management. It is always very hard of you without seeing an example scene.

Could make a small package with the case  ?

Offline piginhat

  • Newbie
  • *
  • Posts: 13
Re: Swipes do not work with planes
« Reply #4 on: January 30, 2017, 02:46:19 PM »
Hi Nicolas, did the shader I send you throw any light on the problem?  I'm totally stuck :-(

Do you need anything more from me?

Thanks


Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: Swipes do not work with planes
« Reply #5 on: January 30, 2017, 09:26:29 PM »
Hi,

EasyTouch uses Unity APIs, the management of the touch is independent of what is in the 3D world (object shader etc ...). It's a bit like saying your joystick does not work anymore since I added a sphere in my scene.

Whatever the scene EasyTouch detect the gestures performed and send them via messages.Selected Object... are additional data relative to layer and camera...

There are 2 possible reasons for your problem :
- The script you wrote
- Your collider management
- Now compared to your mail, the fact that you have several camera, and that they are not correctly set in EasyTouch

Offline piginhat

  • Newbie
  • *
  • Posts: 13
Re: Swipes do not work with planes
« Reply #6 on: January 30, 2017, 10:32:41 PM »
OK I think there is some misunderstanding, there is no script I have written, there is no collider I have added, I am only using Easy Touch?

However hopefully the files I am sharing with you may help you to understand why Easy Touch is doing this?

The dropbox share has 4 files:

stones.jpg which acts as the vuforia trigger

EasyTouchTest-depthmask-on.apk shows the app with the depth mask on

EasyTouchTest-depthmask-off.apk shows the app with the depth mask off

EasyTouchTest.zip is the unity project.

You will need to create a free Vuforia account and free licence to add to the AR Camera in the Main scene.

What I have discovered after creating this sample for you is that it is the plane that causes the problem NOT the shader as you can see when running the apps.

If you pinch anywhere on screen the gesture works fine.

If you swipe anywhere on the plane the swipe gesture does not work, BUT, swipe outside the plane and the swipe works perfect.

So I hope you see there is NO code in the project that is mine, only standard vuforia and easy touch.

I hope this all makes sense?

Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: Swipes do not work with planes
« Reply #7 on: January 31, 2017, 09:23:13 AM »
So,  We are in the presence of a collider problem. But it is easy to solve.

EasyTouch makes a difference between the Swipe and the Drag.
Swipe =  slip gesture when the touch start over nothing
Drag = slip gesture when the touch start over an object

When you activate the plan, I assume that you activate its collider at the same time. From this moment, EasyTouch detect the plan and considers the gesture as a drag

There are several ways to manage this, if you really need to collider on the plane

Simple Solution :
Just activate the option : Always send Swipe event in EasyTouch inspector
With this the swipe event will be send even in cas of drag

Modre advanced solution
1-   Change the plane layer, and exclude it from Easy Touch

Offline piginhat

  • Newbie
  • *
  • Posts: 13
Re: Swipes do not work with planes
« Reply #8 on: January 31, 2017, 09:48:58 AM »
Hi,

OK so how do I do either of these suggestions as I do not see anywhere on the QuickSwipe inspector options to make them?

NOTE: I am always unable to attach an image file using the Attach option below?  So I have to end up emailing them to you?



Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: Swipes do not work with planes
« Reply #9 on: January 31, 2017, 10:05:35 AM »
Hi,

As stated in my mail last night (with screenshot), the setting is in the EasyTouch inspector, not in the inspectors of the quick gesture component

But you have to add an EasyTouch object, with a right click in hierachy view and don't use the automatic creation.

Regards,

Nicolas

Offline piginhat

  • Newbie
  • *
  • Posts: 13
Re: Swipes do not work with planes
« Reply #10 on: January 31, 2017, 07:34:57 PM »
My bad, oops good to know both these options are available.

However, I have just found out that if I check 'Allow swipe start over me' the issue is resolved?


Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: Swipes do not work with planes
« Reply #11 on: January 31, 2017, 07:42:15 PM »
In some case yes, but not if you have another object with collider like your plane