Hello everyone.

We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.

On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.

So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality. If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers. And always feel free to hit us up on Twitter @MxdRealityDev.

Tap to Place Issue

Hello,
I am having problems with a tall hologram automatically laying down as soon as I airtap it...
How do I resolve this so that when I Tap to Place it will always stay on its original axis?
Thanks for your help in advance!!!

Best Answers

  • holonutholonut
    Accepted Answer

    Thank you for your quick response Jesse!
    I tried what you suggested and the hologram now stays upright! :)
    However by doing this half of the hologram (Building) does not rest within the spatial map drawn out for it.
    Half of the building goes above and half below?
    Any ideas?
    Thanks!

  • holonutholonut
    Accepted Answer

    Never Mind...
    I have the answer to my issue!
    The origin point (aka pivot point, but useful to think of it as the origin of a 3D model) of the 3D game objects and its relationship to the invisible skin of the collider is what is important here.

    Since Unity isn't really a model editing tool (like 3DS Max, Maya or SketchUp etc..) it turns out that editing the pivot point of a 3D model is not an option in Unity (in the traditional sense of editing anyway).

    Since something like a default 3D Cube in Unity has its origin point in the center, and since you can't edit that origin point, when you move that 3D cube (by its origin) it will get placed at whatever location you specify, but the origin will be at that location not the bottom of the cube as you might prefer in this case, so half of the cube is above the surface and half below.

    This is one of the two common gotchas that people run into when using the TapToPlace approach to moving objects (which moves the object by its origin) both of which can be solved by using the wrapper empty gameobject parent approach to faking a new origin.

    1st common gotcha: If the origin of the object is not on the corner or surface that you would like to lock onto the destination point the object does not end up sitting where you want it.

    2nd common gotcha: If the origin point is located outside of the main 3D Object and you size your collider just around the main 3D Object the detection logic never fires and you can't move the 3D object. (as described in this post)
    Thanks again Jesse for your help!!

Answers

  • @holonut - The TapToPlace.cs script does try to orient the model to stay facing you. I don't know if that's what is tripping you up. You can try commenting out line 112 and see if that solves your problem.

  • holonutholonut
    Accepted Answer

    Thank you for your quick response Jesse!
    I tried what you suggested and the hologram now stays upright! :)
    However by doing this half of the hologram (Building) does not rest within the spatial map drawn out for it.
    Half of the building goes above and half below?
    Any ideas?
    Thanks!

  • holonutholonut
    Accepted Answer

    Never Mind...
    I have the answer to my issue!
    The origin point (aka pivot point, but useful to think of it as the origin of a 3D model) of the 3D game objects and its relationship to the invisible skin of the collider is what is important here.

    Since Unity isn't really a model editing tool (like 3DS Max, Maya or SketchUp etc..) it turns out that editing the pivot point of a 3D model is not an option in Unity (in the traditional sense of editing anyway).

    Since something like a default 3D Cube in Unity has its origin point in the center, and since you can't edit that origin point, when you move that 3D cube (by its origin) it will get placed at whatever location you specify, but the origin will be at that location not the bottom of the cube as you might prefer in this case, so half of the cube is above the surface and half below.

    This is one of the two common gotchas that people run into when using the TapToPlace approach to moving objects (which moves the object by its origin) both of which can be solved by using the wrapper empty gameobject parent approach to faking a new origin.

    1st common gotcha: If the origin of the object is not on the corner or surface that you would like to lock onto the destination point the object does not end up sitting where you want it.

    2nd common gotcha: If the origin point is located outside of the main 3D Object and you size your collider just around the main 3D Object the detection logic never fires and you can't move the 3D object. (as described in this post)
    Thanks again Jesse for your help!!

Sign In or Register to comment.