TapToPlace sets anchor on start --> cannot move by setting IsBeingPlaced manually
Hi,
I have a game object with the TapToPlace component attached to it. Also there's a SpatialMappingManager and a WorldAnchorManager in my scene. When the application starts, the TapToPlace component attaches an anchor for the object.
Now when I want to start placing the object manually by setting IsBeingPlaced = true; (not by clicking it --> OnInputClicked is not called, hence the anchor is not removed!) the object won't move since the anchor does not allow it.
Is this an issue or am I missing something?
Best regards, Dino
You want to remove the anchor before attempting to move the object. You also probably don't want to put an anchor on it initially before attempting to place it.
I'll take a look at the test scene to make sure this is working correctly.
Tap to place test scene does not work in editor, so if you're trying this out make sure you're either doing it in the emulator or on device.
Hmm, can't seem to get this scene to work on device.
I had the same issue. So what I did was called the InputClicked passing null from a button near the object I wanted to move. Much like how the modify button works on all the holograms from the holograms menu. Also, I believe you need to have a collider on the object and the spatial mapping setup for it to work in the editor and device. In the editor you will need that "object surface observer" reference for what the mesh will look like. I just used a plane.
The problem is with line 67, in the start method, where for some reason a world anchor is being set. Not sure when that was added, or for what purpose, but that is what is keeping this from working correctly. When I commented that line out, it started moving the object as expected. Click event registers on objects that have a collider, mine was not working because I had a UI object without a collider.