Fuel bar doesn't work!

So, I’m trying to make a fuel bar, but it isn’t working completely.

I have an object in my scene and if I collide with it, I want it to fully set my fuel storage back to 100.
But that is not working, and I don’t know why.

PickUp script

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

public class PlayerPickUpManager : MonoBehaviour
{
    private PlayerMovement playerMovement;

    void Awake()
    {
        playerMovement = GameObject.FindObjectOfType<PlayerMovement>();
    }

    private void OnTriggerEnter2D(Collider2D coll)
    {
        if(coll.gameObject.CompareTag("Player"))
        {
            Destroy(gameObject);
            playerMovement.AddFuel();
        }
    }
}

AddFuel Method

public void AddFuel()
    {
        slider.value = 100;
    }

This is happening because you are destroying the gameObject before you call the “AddFuel” function.
So, the “AddFuel” function won’t get called…
To fix it just change it to

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

public class PlayerPickUpManager : MonoBehaviour
{
     private PlayerMovement playerMovement; 

     void Awake()
     { 
          playerMovement = GameObject.FindObjectOfType<PlayerMovement>();
     } 

     private void OnTriggerEnter2D(Collider2D coll)
     {
          if(coll.gameObject.CompareTag("Player")) 
         {
               playerMovement.AddFuel()
               Destroy(gameObject);
          }
      }
}