Hello i have a script that counts score and a script on chests that tries to access that score script on the player. There are multiple chests and they are being instantiated in the Start Function.
But when i try to access the PLayer score scirpt it doesnt find it. The player is tagged with Player.
What am i doing wrong?
In the start function:
SCOREMAN = GameObject.FindWithTag("Player").GetComponent<ScoreScript>();
On the player:
public class ScoreScript : MonoBehaviour
{
public Text ScoreText;
public float Score;
void Update()
{
ScoreText.text = Score.ToString("F0");
Score += 45.2f * Time.deltaTime;
}
}