error on script?!

hi i have this error on unity
[
NullReferenceException: Object reference not set to an instance of an object
Bottom.OnCollisionEnter2D (UnityEngine.Collision2D collider) (at Assets/Scripts/Bottom.cs:17)
]
and my code is right i think

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Bottom : MonoBehaviour {

    // Use this for initialization
    // Update is called once per frame
    private void OnCollisionEnter2D(Collision2D collider)
    {


        GameControllermenu.instance.Coin();
   

    }
}

[CODE]

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;


public class GameControllermenu : MonoBehaviour 
{

    public static GameControllermenu instance;


    public static int coin;
    public Text cointext;


    public void Coin()
    {
        coin++;
        Updateco();
       // SoundSystem.instance.PlayCoin();


    }
    public void Updateco()
    {

        cointext.text = "" + coin;



    }
}

[CODE]

I assume the line it points to is what it labeled as line 14 on here. Your Gamecontrollermenu.instance is never assigned to - it’s going to be null. At some point (probably in Awake() ) you need to set it to “this” in Gamecontrollermenu.

u are aweasome, do u know how to call a coin vale from other scene ?

Call DontDestroyOnLoad on your Gamecontrollermenu gameObject. If you start getting duplicates as you load scenes, then you can have the script check in Awake (), before it sets .instance, to see if instance is null - if it’s not, there’s already one of these, so the new one should destroy itself.