cancel
Showing results for 
Search instead for 
Did you mean: 

How to erase Spacial Anchors and more... Please help!

Dingenonma
Protege

Hola!

I successfully created Spacial Anchors and recall them in my virtual/real space following this tutorial:

https://developer.oculus.com/documentation/unreal/unreal-lsa-tutorial/

But now I would like to know how can I erase all of them them inside the blueprint, and also how could I store each one with different names (sequentially as I press "create Anchor"), so I could recall them later individually. I don't find any info about it online...

Thanks a lot in advance!

LoadAnchorsUA.png

1 ACCEPTED SOLUTION

Accepted Solutions

Dingenonma
Protege

@dario.maciel I found the solution!

It was so easy... simply "Delete game from slot" and put the name of my slot game assigned before.

Thank you a lot anyway for all your support

Have a great time!

View solution in original post

12 REPLIES 12

dario.maciel
Heroic Explorer

to erase all of them there is a blueprint "Oculus async erase anchor" (or similar, i using a project I amde in unreal 4.27 for reference)
the actor for the input on this node is the actor that you used to spawn that goes into the Create sync spatial anchor. You need to store this actor somehow (in an array for example) and then do a for loop of this array and erase all these actors and destroy them too. (it will delete the UUID of the actor and delete the actor itself)

Thanks a lot for your response!

But I was already trying a lot of options with this " "Oculus XRasync erase anchor" modul and I just don't know how to proceed. 

Where should I connect that node and with which logic?? 

Thanks again

anchorerase.PNG

Look at these images and see if it helps.
The idea is: if you spawn your anchors, save the actors in an array. If you create the anchor, save the actor used to do it an array (keep adding to the array). If you want to erase, you do a foor loop of this array and erase and destroy these actors. After that you clear the array so you can be sure its empty again. This array you save on the game slot, so you can load it properly.

spawn.PNG

create.PNG

erase.PNG

anchorerase2.jpg

somehting like this . see if you understand

Dingenonma
Protege

Wow! That's so great

Thanks a lot for your response. I will give it a try very soon and hopefully succeed!

I followed the official Oculus tutorial for this... so I just did what it explained and not ready to change much of the logic before getting totally lost

please let me know if you succeed. to delete a specific anchor, you need to somehow get the reference of the specific actor and then erase it and delete it

I really appreciate it!! I will try as soon as I have access to my project

Dingenonma
Protege

Auch! I have been today trying to solve this... and I had to give up.

I really don't understand what you mean... and I cannot change even one node of all that logic, the tutorial took me one hour to complete, and now it works! ... Any little change means it stops working.
If it would be only adding the "erase anchor" node somewhere in this logic:

https://developer.oculus.com/documentation/unreal/unreal-lsa-tutorial/

But you suggest me to change thins I dont' even understand.

Isn't there a way to just add this erase node to my logic without changes?

One thousand thanks

Add an action mapping so you have a trigger to erase the anchor (for example, the A button of the controller)
Add the actor from the created anchor to an array and store it on the gameslot you are saving.
To erase it, do a for loop in this array and erase every index of it and destroy the actor. After that, clear the array.

Send me a dm and I can try to help you if you dont succeed.