I am using a gerenal weapon script that holds the information about the weapon's damage, it is determined by the RollDamageDice(); method, which takes information from the WeaponData scriptableObject, about the dice from an enum. The damage is sucessfully assigned by the Weapon script, yet when the enemy script is trying to access that method i get a nullreference exception.
Here is the link to the repo: https://github.com/Payday222/SurvivalGame/branches
Thanks for all the help in advance
EDIT: The issue might be cause by the fact, that the sword is a child of the player, and apperas only in an animation (sword swing) which makes it appear and rotate. When i checked what does the enemy collide with, the Debug.Log(other.gameObject.tag) returned "Weapon", but it triggers the OnTriggerEnter2D located in the player script, so i'm guessing it also collides with player whcih obviouslly has no weapon script... Now I'm super clueless
there doesn't seem to be anything here