AssetPreview.GetAssetPreview broken, anyone ?

Is it only me that encounter problems with Unity 4.3.1, whatever I do, seem can not make the GetAssetPreview to work, always return null. Can anyone help ?

thanks.

I am seeing the same issue as well. Attempting to get a texture of a simple cube already loaded in the Scene and the function call to AssetPreview.GetAssetPreview always returns null. Also running version 4.3.1 on Windows 8.1.

I’ve seen several post complaining about this, even the bug report that being delete, any idea why ? Unity ? Anyone at Unity is watching this ? At least, if it’s not a bug, give us some explaination and show the correct way to do. Silent is not the solution :frowning:

Hey,

did you have any luck with it ? I am facing a similar problem.

Take a look at that link.

I am still stuck though.

I’ve gotten it to work. The object you are passing into GetAssetPreview should be a prefab from your project, and should be assigned as either the Object or GameObject class types. If you assign the prefab as a Transform, you should pass the Transform’s gameObject into GetAssetPreview.

Here’s 3 different examples that have worked for me.

Object prefabObject;
Texture2D prefabObjectPreview = AssetPreview.GetAssetPreview(prefabObject);

Transform prefabTransform;
Texture2D prefabTransformPreview = AssetPreview.GetAssetPreview(prefabObject.gameObject);

GameObject prefabGameObject;
Texture2D prefabGameObjectPreview = AssetPreview.GetAssetPreview(prefabGameObject);