Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

unity3d can't create instantiated mesh reference in awake

$
0
0
I'm dealing with an annoying bug that occurs randomly. Once it occurs, it will stay this way until i delete and recreate the object the script is attached to. The Script is called AnimatedTexture.cs. It awake function looks like this MeshFilter myMeshFilter; Mesh myMesh; Awake() { myMesh = myMeshFilter.mesh; } Many Game Objects in the scene have this script attached to them. When Unity is in play mode, selecting a game object with this script attached shows the mesh filter is using an instantiated copy of the mesh. So the bug is, sometimes, the mesh doesn't get assigned and the mesh is not using an instantiated copy. Could this be a script execution order issue?

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>