Little problem with OnTriggerEnter

Hi guys, I have this script here:

enum pickupType {Ammo, Health};
var PickupType : pickupType;

function Update () {


function OnTriggerEnter(other : Collider) {
if( == "Player" && pickupType == "Ammo") {
GameObject.FindGameObjectWithTag("Player").GetComponent("WeaponScript").clips += 1;
Debug.Log("Ammo Applied!");

It is attached to game object and its collider is set to trigger. However whenever I walk over it nothing happens. I have tried using and none seem to work. Does anyone see what I might be doing wrong?


You should use small letters to start variables and Caps for Classes and Enums and Such.

enum PickupType {Ammo, Health};
var pickupType : PickupType;

pickupType == PickupType.Ammo  (no quotes)

Also you can use collider.gameObject to avoid doing the Find