I'm attempting to have a sphere that I would like to be collected by the player. I've tried a few different scripts used in YouTube tutorials but none have worked for me. Below is a script I am currently using from this video here.
Collection Script
function OnCollisionEnter(collision : Collision)
{
if(collision.transform == player)
{
Destroy(gameObject);
}
}
I've made sure that the sphere is marked as a trigger but my...{
if(collision.transform == player)
{
Destroy(gameObject);
}
}
Collection Script