Search Unity

Question Unity OpenXr works in play mode but build doesn't work

Discussion in 'XR Interaction Toolkit and Input' started by Shore99, Mar 10, 2023.

  1. Shore99

    Shore99

    Joined:
    Jan 12, 2023
    Posts:
    1
    I'm new to unity and I'm trying to develop a game with virtual reality. I'm using unity version 2020.3.1f1 and an HTC Vive Pro headset and also using SteamVR.
    From play mode of unity the game works perfectly but when I try to run the application from the build, SteamVR keeps loading, and from the pc I see the application starting but it stays still and doesn't load all the textures, but I can hear the audio.
    I state that I have a single scene with different environments inside, and I move between these environments simply by teleporting the player from one side to another.
    I tried to create a new project with only the player, and in that case I was able to have a working build, but as I try to insert even just one of the enviroments I have into the project, the problem returns, in play mode it works but the build doesn't. So I can't figure out if it depends on one of my environments or assets or if there's something else...
     
  2. ericprovencher

    ericprovencher

    Unity Technologies

    Joined:
    Dec 17, 2020
    Posts:
    267
    The first thing I’d try is to update to the latest 2020.3 lts and update all xr related plugins.

    Hope that’s all it takes!
     
  3. unity_espresso

    unity_espresso

    Joined:
    Jul 14, 2023
    Posts:
    5
    So I'm a super newbie, so this might be an obvious thing you've already tried... but I just had this exact same problem.

    Go to the File Menu > Build Settings...
    Look at the Scenes In Build at the top. It Scenes/SampleScene selected by default, but *not the one I had been developing on*. I checked the development scene and unchecked the sample scene, and everything works great! It also runs in realtime, unlike the laggy as heck scene player.

    Valve Index on Win11 / 3080 RTX / 32GB RAM / i7 12700F