NullRef exception in AmplifyMotionObject [SOLVED]
Posted: Sat Mar 29, 2014 7:07 pm
I get this nullref exception when I instantiate objects with the AmplifyMotionObject script attached.
The error appears only when there is no camera with the amplify motion effect in the scene. In my case, it happens when I start the game in batchmode for dedicated game server instance, where it doesn't create cameras.
I was thinking about a workaround to remove all AmplifyMotionObject scripts right after instantiating objects (but before start), in case there is no camera, but that's a bit cumbersome. Or just add a dummy camera with the effect.
Is there an easier fix for this? There is no way to get the source code for AmplifyMotion, right?
- Code: Select all
NullReferenceException: Object reference not set to an instance of an object
AmplifyMotionObject.Start ()
The error appears only when there is no camera with the amplify motion effect in the scene. In my case, it happens when I start the game in batchmode for dedicated game server instance, where it doesn't create cameras.
I was thinking about a workaround to remove all AmplifyMotionObject scripts right after instantiating objects (but before start), in case there is no camera, but that's a bit cumbersome. Or just add a dummy camera with the effect.
Is there an easier fix for this? There is no way to get the source code for AmplifyMotion, right?