Log in or register to post comments

Plane Finder + Touch Input best practices

February 27, 2018 - 3:47am #1

Hey everybody!

I'm developing an AR app with the new ground plane feature of Vuforia and Unity and was wondering about best practices.

My wanted behaviour is the following: User finds plane and touches screen to place 3D model. Then if user touches one of the models collider (or uses two finger gestures) certain actions (animations/scripts/whatever) are carried out, if user touches/tabs outside the model on the ground plane the model is repositioned. So essentially the DeployStageOnce (from tutorial) behaviour combined with custom touches on colliders (or gestures like swipe/pinch) which should not reposition the model.

Now judging by reading this forum it's not a straightforward task to separate OnInteractiveHitTest() reposition touch and other touches (Lean Touch, custom, whatever). The way I did it was by calling my own function from Plane Finder Behaviour, by putting it in the On Interactive Hit Test field. In this function I check for current touches and evaluate them (like if a touch is actually on one of my colliders or if a gesture is happening) and only if I come to the conclusion that a repositioning on the ground plane was intended by the user I call OnInteractiveHitTest of DeployStageOnce and pass the HitTestResult parameter.

Now I feel this is not nice design and probably not the way to do this intended by Vuforia, so I'm asking here what would be a better way to handle this?

I read about disabling Plane Finder Behaviour but I feel like that wouldn't be a solution for my use case.

Thanks for reading and any pointers in the right direction :)

Plane Finder + Touch Input best practices

April 28, 2020 - 1:44pm #2

Can you please share the script, I am facing a lot of issues trying to solve it. PLEASE!!!!

Log in or register to post comments