Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Hololens: strange rotation / localrotation / forward problem

Discussion in 'Windows Mixed Reality' started by Firlefanz73, May 28, 2018.

  1. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,011
    Hello,

    I have a gameobject in my scene, which is rotated one the Ground somehow when app starts, it does not have the original orientation when started.

    Now it has a Hierarchie, and I want to move one of it's childs Forward (the child's "own" Forward).

    I tried Things like
    thischild.transform.localposition += thischild.transform.forward
    and some Workarounds with Translate, but everytime I Restart the app and have it initially rotatated it in some other direction somehow, it moves in a different direction…

    As far as I know the transform.forward of a gameobject is always pointing to the same direction (seen from / relative to this gameobject)?

    Is it different in a HoloLens Scene? I understand is the original mesh object is rotated wrong, the "thischild.transform.forward" Maybe Always on it's left side, but how can it be everytime I start it is somewhere else?

    How can I move my child gameobject Always forward (there maybe a offset angle I could find out), no matter how it or its parent is rotated in the Scene in a HoloLens app?


    Thanks a lot for a hint, I absolutely do not understand why it is not working…
     
  2. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    546
    It sounds like might need to have a persistence space with objects, mainly because at each launch of the app the HoloLens is the world origin. That could be what is causing some confusion, can you send some screen shots maybe some more info about the code that is questionable in causing the issue?