Questions about building game

  1. Why is my game not changing textures in build version? It works in editor mode, here is the code:

    Renderer renderer = gameObject.GetComponent(); renderer.material.EnableKeyword("_DETAIL_MULX2"); renderer.material.SetTexture("_DetailAlbedoMap", cracked0);

  2. Has anyone experienced a degrade in quality of audio clips when building their game? The sounds sound muffled and distorted a little in the built version.

  3. Is there a option to change the graphics quality setting when building webgl? I noticed shadows are not being rendered and the lighting is off.


Edit

Questions 2. and 3. have been answered, just don’t understand question 1.

I think this:

Renderer renderer = gameObject.GetComponent();

Should be like this:

Renderer renderer = gameObject.GetComponent<Renderer>();

Maybe i’m wrong, but try that :slight_smile:

  1. Answered by @LuFerSan
  2. Check the audio in the Project tab. Usually, it has something to do with compression, so I would play around with those. Also, I would take a look at the Audio settings in Edit>Project Settings>Audio.
  3. Check Edit>Project Settings>Graphics/Quality and make sure you have everything set to the highest levels. WebGL Isn’t the best when it comes to building, but then again, I’ve only gained that from personal experience.