using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Bullet : MonoBehaviour
{
public Rigidbody2D rb;
public int coins;
void Start()
{
}
// Update is called once per frame
void Update()
{
rb.velocity = new Vector2(0f, 8f);
}
private void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.CompareTag("Plane"))
{
coins += 5;
}
}
}
FYI I have assigned the tags