I have set up a "Focus shot" where if the player has melee focus on a target, the target is saved in a list variable. If the player shoots in with focus, they enter an aiming state which uses the "AimAtTarget" selection (with the focus target variable set as the aiming target), then the player waits for 0.1s, then shoots and stops aiming. With the Unity error pause turned off, this works perfectly. The issue is that when the error pause is on, I get multiple errors while the player is still aiming.
The error is:
NullReferenceException: Object reference not set to an instance of an object
GameCreator.Shooter.AimingAtTarget.Update () (at Assets/Plugins/GameCreator/Shooter/Mono/Classes/Aiming/AimingAtTarget.cs:43)
GameCreator.Shooter.CharacterShooter.Update () (at Assets/Plugins/GameCreator/Shooter/Mono/Components/CharacterShooter.cs:101)
GameCreator.Shooter.PlayerShooter.Update () (at Assets/Plugins/GameCreator/Shooter/Mono/Components/PlayerShooter.cs:17)
When I double click the error message, it opens line 43 of AimingAtTarget.cs.
This error only occurs when using the AimingAtTarget selection. when I use another selection such as aim forward or towards the camera, it works with no errors, but the bullets don't always hit the target. Is there something I am doing wrong, or can the aim at target just not be used this way?
Thank you in advance,
Customer support service by UserEcho