Skip to content

Instantly share code, notes, and snippets.

@vjgrayman
Last active August 7, 2019 12:54
Show Gist options
  • Save vjgrayman/0dae86b7f69bc95d4c1cc25ee0a4f931 to your computer and use it in GitHub Desktop.
Save vjgrayman/0dae86b7f69bc95d4c1cc25ee0a4f931 to your computer and use it in GitHub Desktop.
[OnTriggerEnter] #CSharp
// vim: syntax=CSharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Collectible : MonoBehaviour
{
// add points
// add powerup ability...
private void OnTriggerEnter(Collider other)
{
if (other.tag == "Player")
{
Destroy(this.gameObject);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment