0
Under review

Error Message when aiming with the "AimAtTarget".

Dante 2 months ago in Shooter updated 3 weeks ago 6

Hello,

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,

Dante

Unity version:
2019.4.0f1
Game Creator version:
1.1.9

Here is a picture of the focus shot Actions.

The same issue also occurs with the aim at position selection.

Under review

Could it be that your character model is not a Humanoid? The error seems to come from the fact that it can't find the correct bone.

My character model is set to humanoid and has all of its bones in the correct position. 


(Sorry for the delayed response, I didn't see this until today)

+1

I think I have a similar/same issue. Is there any chance of a fix or work around for this? Aim camera direction is working for me in the interim but is not optimal.

Strange, this error refers that the weapon's model is set to be part of a human bone (like Right Hand), however, it can't find the correct bone.

If the 3d model is not a humanoid character, simply set the weapon to be attached to the root of the bone. I'll open a ticket to have a more thorough look at this.

Despite this, just to test this, can you try setting the weapon's attachment to "Root"? Even if his doesn't make sense, let's see if this still throws any errors.

Hello, sorry for the delay again. 


I just tried it and its giving the same result.