[XR Interaction Toolkit] Object deletion

Dear Community,

I have experienced some trouble when deleting an AR object with the new SelectionInteractable - Script on it placed in the scene. Is this an expected behavior? Or has somebody managed to delete such placed prefabs without bricking the scene?

The main problem with this after placing and only hiding the objects instead of destroying them the scene will slow down fast.

I would appreciate any help in this matter.

Greets,
Dan

Hello,
This was pointed out to us and is in our backlog. Some of our classes don’t actually clean up all their references and registrations, and I need to do a pass on that in the very near future.

Sorry for the hassle.

1 Like

Thank you for this information. This seems like a major bug for an AR - App.

When can we expect a fix here? Or a practicable workaround? :slight_smile:

Greets Danex

Its not in the first batch of things we’ve fixed (which will be out soon). Hopefully in the next set!

1 Like

If you want to use it now, the fix is just two lines:

1 Like

It is my issue - so just saw it. Thank you :wink:

Yeah, and I am soraryu on GitHub, just thought I’d point it out here as well :slight_smile:

Awesome thanks - maybe there is such a workaround for the non blocking GUI as well when AR Raycasting as well :slight_smile:

Has this been fixed?! I have the latest Unity 2019.3 and XRToolkit 0.9.3 and anytime I delete an object than has some Interactable components on it it bricks the scene and nothing works anymore. This is a blocker. Am I missing something? Thanks much.

It’s not fixed in 0.9.3 yet but known and on the list. In the meantime, it’s a 2-line fix: https://github.com/Unity-Technologi…lkit-Examples/issues/8#issuecomment-578129590

2 Likes

Yeah, missed the two line fix reply. Made the fix now and good to know its on the list. Thanks.

1 Like

Hi,
could you please show me your deletion objects part of codings?. i have already had selection, rotation, and scaling function. but i havent found out the coding for deleting objects. already browsed the almost entire youtube and google still not yet found the solution…

Hi,
could you please show me your deletion objects part of codings?. i have already had selection, rotation, and scaling function. but i havent found out the coding for deleting objects. already browsed the almost entire youtube and google still not yet found the solution…

Hey @roslim ,
The error behavior from the original thread when deleting objects should be properly handled now. XRI is cleaning up any of the references under the hood that were causing problems before. You will need to update to a newer version of the XRI Toolkit to take advantage of these fixes (currently at 2.1.0-pre.1).

In terms of deleting the object, you can just use the standard Unity convention: gameObject.Destroy(). Let us know if you have any other questions.

1 Like

sorry for my fool question, i am very new to this.
i dont get what you mean. i just followed some tutorials on youtube, how to spawning objects and then using xr interaction to select, rotate, and scale object, and those scripts which related already provided by xr interaction toolkit right?. my problem is i dont understand how to make selection on spawned object in order to delete the object by clicking the delete button i created, as it is not included in video. thank you

1 Like