Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
jasonh's avatar
jasonh
Honored Guest
8 years ago

How to get the Custom Avatar Hand Mesh to Load in More Than One Scene?

I am experiencing an issue where if I have 2 scenes in my build, and I transition to the second scene, the shading for the avatar's hands disappears. 

I am executing the suggested code below in each scene:

https://developer.oculus.com/documentation/avatarsdk/latest/concepts/avatars-gsg-unity/#avatars-gsg-unity

It loads the shaders in the 1st scene, but the for some reason it doesn't load the shaders in the second scene. 
If I make a build with just the second scene, it loads as it should.

What is the best practice to keep the custom avatar mesh, and to perpetuate throughout the various scenes of your app/game?

Thank you for your help.


1 Reply

Replies have been turned off for this discussion
  • jasonh's avatar
    jasonh
    Honored Guest


    Hi,

    Have you incorporated this function in your scene?

    https://docs.unity3d.com/ScriptReference/Object.DontDestroyOnLoad.html

    When loading a new level all objects in the scene are destroyed, then the objects in the new level are loaded.
    In order to preserve an object during level loading call DontDestroyOnLoad on it.
    If the object is a component or game object then its entire transform hierarchy will not be destroyed either.



    Hello. Thank you for your response.  I did not use this function. I'll give it a shot in the next iteration of the game.