0
Under review

[Melee] Null exception randomly on perfect block

rexdefuror 1 month ago in Melee updated by Mathalous 6 days ago 6

Summary:

Null Exception randomly occurs on perfect block/parry.


Description:

NullReferenceException: Object reference not set to an instance of an object GameCreator.Melee.CharacterMelee.LateUpdate () (at Assets/Plugins/GameCreator/Melee/Mono/Components/CharacterMelee.cs:192)

This happens due to ComboSystem not being able to get the current clip from combo system.

What I also noticed is that right before this happens, a Stop method in ComboSystem has been executed, that sets the currentCombo entity to null.

Unity version:
2019.4.1f1
Game Creator version:
1.1.9

Update on this matter. It happens when the weapon blade collides with the player when blocking.

Under review

Do you have the entire log? Everything that is printed in the console. This will help us narrow down the line of code issuing the exception.

That was actually everything in the log, I'll check if anything else could be found in the stacktrace.

As for where the exception is issued "attack" in the LateUpdate method is null when this happens, and it throws a null  exception when trying to do the "if (attack.pushforce" part. Probably due to weapon colliding with the character while triggering a block and not an attack. so the combo system doesn't find any "attacks" and thus breaks. From what i see there are no fallbacks for this edge case in the code.

The console should print a long message below when selecting it. If you can copy & paste that, it will help us. The line reported doesn't really inform of much, since it basically tells the "attack" object is null, but not from where it comes from.

I got this too. It is a nullReferenceException on CharacterMelee line 191. Attack == null. I suspect this happens when the melee clip is updated (in update) to end just before the hit happens (in late update. It can be reproduced pretty easily in the Melee example settup by trying to git gud with the perfect block.

Full message:

NullReferenceException: Object reference not set to an instance of an object
GameCreator.Melee.CharacterMelee.LateUpdate () (at Assets/Plugins/GameCreator/Melee/Mono/Components/CharacterMelee.cs:191)