I need Help I don't Know why this is not working im new to Unity So i may be under looking something

So I’m am trying to access a variable through 2 Scripts
One script is called Add 1 per second.cs and the other one is called Coins_display.cs

second script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Add1persecond : MonoBehaviour
{
Coins_display coins_Display;
public GameObject add1persec;
void Awake()
{
coins_Display = add1persec.GetComponent<Coins_display>();
}
// Start is called before the first frame update
void Start()
{

}
// Update is called once per frame
void Update()
{
add1persec.coinsAmount += 1;
}
}

Coins_display script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Coins_display : MonoBehaviour
{
public static int coinsAmount;
private Text coinsCounter;
// Start is called before the first frame update
void Start()
{
coinsCounter = GetComponent();
coinsAmount = 0;
}
// Update is called once per frame
void Update()
{
coinsCounter.text = "Coins: " + coinsAmount;
if (Input.GetKeyDown(KeyCode.Space))
{
coinsAmount += 1;
}
}
}

I don’t know why it’s not working Please help!

I don’t Know How to use the tags so if it miss lead You sorry for that

How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

This is the bare minimum of information to report:

  • what you want
  • what you tried
  • what you expected to happen
  • what actually happened, especially any errors you see
  • links to documentation you used to cross-check your work (CRITICAL!!!)

How to understand compiler and other errors and even fix them yourself:

If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: Using code tags properly

You may edit your post above.