WARNING : This site is outdated and the PopcornFX team will no longer answer your questions here.
For all support questions please go to our Discord server
0 like 0 dislike
It seems that when I build my game and run it, it throws Null reference exception errors in te PkFxCamera class (Line 123) However when I run the game in-engine, no errors are thrown. Has anyone had this issue? and if so, how did you resolve it?

closed with the note: Answered
by Tim (140 points)

Which version are you using?
Do you have the PKFxCamera component attached to your gameobject or the PKFxRenderingPlugin?
Currently using Unity plugin version 2.8.
I have the PKFxRenderingPlugin component attached
That's weird, line 123 in PKFxCamera.cs is a comment...
Are you sure about that number?
Triple checked, it is that number for sure. It's throwing the error at 'if (!Shader.Find(g_DepthShaderName).isSupported || !SystemInfo.SupportsRenderTextureFormat(g_DepthFormat))'

within the ResolveDepthShaderAndTextureFormat() Method
it seems that replacing PkFxRenderingPlugin with PkFxCamera works.... not sure why.
Well, if it fixes your problem then so be it, the PkFxCamera component should work fine on its own in Unity 5+. However I suspect something might have gone wrong at some point during an update because that line number definitely isn't right from a fresh update (unless you modified the sources)...