0
Fixed

NullReferenceException if 'Stop Shake' is called first - before 'Start Shake'

mirec313 4 months ago in Game Creator updated by Marti (Lead Developer) 4 months ago 3

Hi

This is just a small bug, but if I call action 'Camera Shake Sustain' with 'Stop Shake' type before an action 'Camera Shake Sustain' with 'Start Shake' it throw a Null Reference Exception.

Unity version:
2019.3.10f1
Game Creator version:
1.1.8
GOOD, I'M SATISFIED
Satisfaction mark by mirec313 4 months ago
Under review

Would you mind sharing the error that appears? Maybe we didn't take the repo steps correctly, but no exception was thrown on our end.

Hi

Just create simple scene with one Player character and Adventure Camera Motor (default properties). Then create simple "stop shake" action and call it - without any "Start shake"

When the actions is called, null reference exeption is thrown:

It is thrown in file CameraShake.cs, line no. 64.

In constructor:

public CameraShake(float duration, CameraShake cameraShake)

the 'cameraShake' reference is null

Fixed

Thanks for the detailed error. I've managed to reproduce this and patched the error. However, it affects a delicate code script, so I've sent you an email to your account with the patch file.

The next update will contain this fix for everyone else. Cheers!