- Home /
Cube material is briefly blue
Hello!
I am having a cube material problem in my racing game. Nothing is wrong if I just enter play mode in the scene, but if I get to the scene (level) from a menu or from another level, the cube material is blue for a brief moment before changing to the right one.
Why does this happen?
Do you have scripts on? If so, does anything play with the materials in the Start and/or Awake functions? If not, does the problem persist all the way through to actual deployment?
It looks like the scene loads the material of the cube for a second or so.
Answer by team_eden · Jan 24, 2015 at 01:20 AM
Attach this to your cube. Also reference http://docs.unity3d.com/ScriptReference/Object.DontDestroyOnLoad.html
function Awake () {DontDestroyOnLoad (transform.gameObject); }
Didn't help. The cubes are still blue for a second or so when loading a new scene.
It looks like the scene loads the material of the cube for a second or so.