Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

Collection Script

$
0
0
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.

function OnCollisionEnter(collision : Collision)
{
if(collision.transform == player)
{
Destroy(gameObject);
}
}
I've made sure that the sphere is marked as a trigger but my...

Collection Script

Viewing all articles
Browse latest Browse all 1466670

Trending Articles