Hi, Our VFX are sometimes missing in our game. It seems to be random, sometime we got them and sometime we don't... So far we noticed : - Recompiling the VFX seems to fix the issue for a time as it is relinking some properties. But doing so for 500 VFX increase our build time from 3h to 10h - Just reimporting with AssetDatabase can fix the issue sometime but also increase our build time too significantly to be part of our build process. - In both ways, fixing the issue doesn't change any file on disk and thus, the fix cannot be shared with the rest of the team. The prefab referencing the VisualEffectAsset are explicitly addressables, but the vfxs are not. Any help would be appreciated.
So in case anyone else is struggling with this too, we managed to fix the issue by launching Unity, reimporting all VisualEffectAssets on the project then close the editor before the actual build process (which opens Unity again and runs various tasks). Now we have all our VFXs in the game and we are only loosing about 5 - 10 minutes in the process. We, however, still don't understand why we have to do that for every build.
hi may i know how do you reimporting all VisualEffectAssets? is it just cut from folder and paste to the same place again? or through other kind of ways?
@qiuji10 We made this script that we call before doing our builds. Code (CSharp): string[] vfxGuids; int i = 0; try { AssetDatabase.StartAssetEditing(); vfxGuids = AssetDatabase.FindAssets($"t:VisualEffectAsset"); for (; i < vfxGuids.Length; ++i) { string guid = vfxGuids[i]; string path = AssetDatabase.GUIDToAssetPath(guid); try { AssetDatabase.ImportAsset(path); } catch (Exception ex) { Debug.LogError($"VFXImportException at path {path} :\n{ex}"); continue; } Write($"VFXImport done for '{path}' ({i}/{vfxGuids.Length})."); } Log($"{i} VFXs reimported."); } catch (Exception e) { LogError("VFXImportException : " + e); } finally { AssetDatabase.StopAssetEditing(); }