google-ar / arcore-unity-sdk

ARCore SDK for Unity
https://developers.google.com/ar
Other
1.4k stars 400 forks source link

Trackables can not be deleted #128

Closed CenekStrichel closed 6 years ago

CenekStrichel commented 6 years ago

It is more feature request than bug. If you call:

Session.GetTrackables<TrackedPlane>( m_AllPlanes );

You always get TrackedPlane, even you load new scene or destroy ARCore Device prefab. It is great behaviour in most cases, but it would be good to have some option to flush all TrackedPlane results manually.

For example when you go to the menu which is not AR and after several minutes go back to the gameplay. So you can track without previous results.

Is it possible to do now somehow?

viitahenri commented 6 years ago

You can keep track of the tracked planes yourself by getting the new ones after you actually started the tracking with Session.GetTrackables(m_NewPlanes, TrackableQueryFilter.New);

Piotr-B commented 6 years ago

We have a related issue.

In our case we have several scenes than a user can launch that are not related to each other. At the beginning of each scene we show detected Tracked Planes and ask the user to tap in a clear space to launch the experience. The first time it works fine but on subsequent scenes we get the old planes (that sometimes ignore raycasts for some reason) and often new planes will start to appear in odd places messing up the experience.

We think this could be avoided if there was some way for us to reset the ArSession and clear the cached planes so that we get a fresh start each time we launch a new scene. However all our attempts thus far would either not clear the plane cache or crash the app entirely (like calling ExternApi.ArSession_destroy(m_NativeSession.SessionHandle) ).

pablisho commented 6 years ago

Hi, this issue has been fixed in ARCore Unity SDK v1.1.0. Feel free to reopen if you still experience the issue.