Maybe it plays actually, but you can’t see that because bounds of the effect are offscreen or position of the effect itself is wrong or world space or something similar?
I had a similar problem and could not find any reason why this was happening.
After some tests, i realized the Visual Effect component is of Type Renderer, and i had some code doing a GetComponentInChildren to get all renderers and then a material.SetFloat(“_SomeProperty”, someValue).
Even though the VFX graph doesn’t contain such property it made the VFX invisible and nothing i did in code could fix it (but touching anything in the inspector made it appear again).
So in the end Dodging the Visual Effect Renderer fixed the problem.
Hello,
About the unexpected behavior after calling renderer.material, what you are describing is probably relative to this issue.
Behind the curtain, the problem is about this documented behavior: If the material is used by any other renderers, this will clone the shared material and start using it from now on.
In case of VFX, it will lead to a desynchronization between the material used by the VFXSystem and the one used by the rendering.
However, I’m not sure it’s related to the prefab issue previously mentioned.