I manage to get it to run but i been having issues with the exceptions, is there any way to fix this?
You need to make sure worldEffect is initialised before calling SetLighting().
Or alternatively, initialise it at the start of SetLighting()
worldEffect = new WhateverClassItIs();
You can see in the exception popup: “worldEffect was null”.
As an aside:
It looks like it’s a class member (the C# convention is the name starts with “_” for private class members (_worldEffect) and upper case for public (WorldEffect)).
the local vars declared later on should start with lowercase (lighting).
This has no bearing on the bug - just makes it harder to figure it out.
That null reference would be my first thing to check too. Initializing `worldEffect` before `SetLighting()` should get rid of that exception. I’d also check where it’s created and whether it gets reset later. The naming advice is useful as well, since cleaner names make these bugs easier to spot.
