Search Unity

my vr scene changes after build process

Discussion in 'AR/VR (XR) Discussion' started by alex4unity, Dec 8, 2018.

  1. alex4unity

    alex4unity

    Joined:
    Apr 28, 2013
    Posts:
    27
    Hey, I got a really weird problem here using VRTK on Unity 2017.4.10

    I made a szene in Unity with the VRTK package.

    2018-12-08 01_34_27-Window.png

    I am using a custom collider and placed it into VRTK Script under the body collider in the custom settings.

    2018-12-04 23_25_46-Window.png

    When I test it in unity editor it works fine. Here is how it looks like when I use the Simulator.

    2018-12-08 01_35_40-Window.png

    It looks similar when I switch to steamVRsdk.

    Now comes the weird part:
    After I build the scene smth goes wrong for some reason. It changes the VRTK setup during the build process and I dont know why! Before I build when I play my scene the VRTK generates my custom body collider and names it [VRTK][AUTOGEN][BodyColliderContainer] like in the simulator image. Its located under the [CameraRig] Object.

    After the build I can see the scene has been slightly modified and when I play it again the Custom BodyCollider does not get generated anymore. It generates a HeadsetCollider [VRTK][AUTOGEN][HeadsetColliderContainer] under Camera (eye) though but I dont know if this would be generated anyway. The build itself ends up having no body collider either when using the VR. But when I use the simulator everything works as intended.

    Now I have to close unity, restart it and reload the projekt. After that everything is like before and works. Even when I save up the changes it made itself after the build process, when I restart the program it still works again.

    My problem here is that I use the custom body collider for my collision detection. I tagged it as a player and when ever a car hits the player smth gets triggered like a crash animation.

    My workaround for now is to just add two body collider. One via VRTKScripts and one on the [CameraRig] itself. And its funny because after the first build one of them disappears, after a second build the other one disappears as well.

    Any ideas?
     
    Last edited: Dec 8, 2018