2D Toolkit Forum
2D Toolkit => Support => Topic started by: Noego on June 26, 2013, 04:37:58 pm
-
Hello,
Here is my problem :
If I create a prefab from a sprite in the scene, the MeshFilter disappears in the prefab.
I suppose that it is due to the fact that the mesh for the sprite was dynamically generated.
So I wonder if there is a clean way to create a prefab with 2D Toolkit?
Thanks,
Noego.
-
The prefab won't have the mesh set as it needs lot be dynamic. Is there any reason you need the mesh on the prefab?
-
If I instantiate the prefab in the scene, the sprite doesn't display because it has no mesh. So I have to commit the collection each time I instantiate a prefab in a scene in order to recompute the mesh.
-
That doesn't sound right - the mesh is created on Awake, so it should create it as soon as its instantiated, unless some data on the prefab is invalid. Can you send me a repro sample to support at unikronsoftware.com?
Also what version (tk2d & unity) are you running?
-
I just found that one of our script on the prefab was disabling the sprite Awake.
Now it works perfectly!
Thank you.