Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Removing XR components from Gameobjects when Game is not running in VR?

Discussion in 'VR' started by EVI_TD, Aug 24, 2023.

  1. EVI_TD

    EVI_TD

    Joined:
    May 1, 2022
    Posts:
    4
    Hello Guys!

    Right now Im working in a prototype of a game and I want to add it a VR mode, I know how to use the XR Plugin and how to start the VR Mode but I have some doubts about using the XR components when the game is not running in VR mode.


    As you know, to grab objects we ussually add the component "XR Grab Interactable" to the game object, but if my game is running in non-vr mode then this component is not needed and its taking resources, which is the common and best way to manage this?.

    Should I ignore this and leave the component in all my prefabs even if those components are not needed?,
    maybe I should remove it from every gameobject when I detect the game is not running in VR mode?

    Regards.
     
  2. EVI_TD

    EVI_TD

    Joined:
    May 1, 2022
    Posts:
    4
    Hello, Any help?
     
  3. Ali_V_Quest

    Ali_V_Quest

    Joined:
    Aug 2, 2015
    Posts:
    138
    I haven't tested this, but I don't believe the Interactable components have a significant performance impact.
    you can simply disable the hand interactors.

    you can of course test this in the Unity profiler to check if they do have a performance impact.
    Hope this helps.