Search Unity

Bug VFX Graph extremely flaky - UnityEngine.GUIUtility assertion failed

Discussion in 'Visual Effect Graph' started by whyatme, Mar 27, 2023.

  1. whyatme

    whyatme

    Joined:
    Apr 4, 2021
    Posts:
    20
    I have some VFX which, seemingly randomly, fails to render and spams two errors:

    Assertion failed on expression: 'materialIndex >= 0 && materialIndex < static_cast<int>(m_Materials.size())'
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    Assertion failed on expression: 'materialIndex >= 0 && materialIndex < static_cast<int>(m_PerMaterialOverrideProperties.size())'
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

    Note: This only happens in the Player / Game mode; it does not happen in the Editor.

    Has anyone else had this? Is it possible I'm configuring something incorrectly or that this is coming from a 3rd party plugin? I'm not using any custom shader or script for this VFX, it seems to happen at random (i.e. about 1 in 5 times this problem happens). The error does not point to any script or file so I cannot investigate. Based on the code it looks like some kind of C DLL