NullReferenceException: Object reference not set to an instance of an object
BeerPickup.OnTriggerEnter2D (UnityEngine.Collider2D other) (at Assets/Scripts/BeerPickup.cs:13)
I get this error now when touching a coin
Here is my script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BeerPickup : MonoBehaviour
{
[SerializeField] AudioClip beerPickupSFX;
void OnTriggerEnter2D(Collider2D other)
{
if (other.tag == "Player")
{
AudioSource.PlayClipAtPoint(beerPickupSFX, Camera.main.transform.position);
Destroy(gameObject);
}
}
}