NullReferenceException: Object reference not set to an instance of an object PlayerShooting.Awake () (at Assets/Script/PlayerShooting.cs:41) UnityEngine.Object:Instantiate(GameObject, Vector3, Quaternion) PuntodeDisparo:Update() (at Assets/Script/PuntodeDisparo.cs:31)
Please, put your code in code tags . It’s unreadable. And please put the whole scripts here, because for example you have an error regarding enemyImage, but there is no other info about it in your code above.
@Nixel2013 Hope you solved your issue. But if you haven’t, to solve NREs (Null Reference Exceptions) you just need to check which line it’s bombing out on, and make sure that a reference is set.
I don’t have the exact line numbers so I’m going to guess the lines that are causing the NRE.
The stack traces complains that something in Awake is causing it (PlayerShooting.Awake () (at Assets/Script/PlayerShooting.cs:41))
I think the two possible offenders are
enemyImage.enabled = true;
enemyHealthSlider.gameObject.SetActive(false);
I’m assuming these are public variables that you assign in the Editor. Can you check if you have actually set a reference in the Unity editor for enemyImage and enemyHealthSlider?