Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Walk around an Object in Unity

Discussion in 'VR' started by ChristianJemarcus, Aug 3, 2020.

  1. ChristianJemarcus

    ChristianJemarcus

    Joined:
    Jun 24, 2020
    Posts:
    4
    Hello, I am trying to create/find a way for the player to walk around an object while using HoloLens 1st Gen. I don't know how to make the main camera the players HoloLens as every time I walk towards an object in game it just moves away. I've tried deleting the main camera and adding the CameraSystem from the MRTK SDK but I have the same problem. How can I fix this?
     
  2. Kent1LG

    Kent1LG

    Joined:
    Dec 3, 2019
    Posts:
    19
    Hi Christian,

    You shouldn't create a camera yourself for an HoloLens application. The MRTK provide some process for setup automatically your scene, try to find the "Mixed Reality Toolkit" on the menu bar and click on "Add to Scene and Configure". This gonna add you two objects : MixedRealityToolkit (Charged of the main behaviour of your app with profiles) and MixedRealityPlaySpace (Who's got the Camera in children, but with the goods components).
    In the MixedRealityToolkit, choose the "DefaultHoloLens1ConfigurationProfile".

    Keep me in touch :D

    Quentin LG
     
  3. ChristianJemarcus

    ChristianJemarcus

    Joined:
    Jun 24, 2020
    Posts:
    4
    Hi, thank you for the help! I did all of this yet I can still not walk around the object. It still moves forwards or backwards when ever I try to walk near it. Could that be an issue with the object itself or still the camera?
     
  4. Kent1LG

    Kent1LG

    Joined:
    Dec 3, 2019
    Posts:
    19
    Ok my bad.
    Can you tell me which version of Unity and MRTK are you using? Are you using the XR SDK from Unity?

    If you are using the XR SDK it could be the issue. It's not stable and confusing to use.
    It's easy to be stuck with it.
    If I'm right you can even see the skybox ahah :confused:

    What I do to make a simple application to walk around a cube :
    • Create a Unity Project (2018 LTS or 2019 LTS)
    • Import MRTK 2.4 by Unity package : link
    • Add to scene and configure
    • Choose "DefaultHoloLens1ConfigurationProfile"
    • I create a root GameObject which I called "Scene" (This is by preference, you don't need to do it you don't want to)
    • Insert a Cube in the GameObject "Scene" at 2 or 3 meters forward (z)
    • Go to Build settings : Switch plateform on UWP : HoloLens, x86, everything else by default
    • Go to Player settings : XR settings (UWP) : check VR Supported, add Windows Mixed Reality to SDKs list (Depth format at 16 bit depth and Stereo Rendering mode at Single Pass Instanced)
    If you can try this and tell me if it's working it could be great :)
     
  5. ChristianJemarcus

    ChristianJemarcus

    Joined:
    Jun 24, 2020
    Posts:
    4
    That worked perfectly! Thank you so so much for the help!!
     
  6. Kent1LG

    Kent1LG

    Joined:
    Dec 3, 2019
    Posts:
    19
    Great !

    Quentin LG