MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

TapToPlace sets anchor on start --> cannot move by setting IsBeingPlaced manually

Open FejZa opened this issue 9 years ago • 5 comments

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

FejZa avatar Feb 23 '17 17:02 FejZa

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.

StephenHodgson avatar Feb 23 '17 18:02 StephenHodgson

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.

StephenHodgson avatar Feb 23 '17 19:02 StephenHodgson

Hmm, can't seem to get this scene to work on device.

StephenHodgson avatar Feb 23 '17 21:02 StephenHodgson

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.

mattfedocsg avatar Mar 14 '17 09:03 mattfedocsg

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.

jessemcculloch avatar Apr 29 '17 19:04 jessemcculloch