Alright, I have been working on this for three hours with no progress.
I have weapon models floating around my scene, and when I touch one, I want it to become my players active weapon.
I am using the First Person Controller Prefab as my player, and have added a capsule collider to the prefab and set the collider to Is Trigger. I also added this script:
function OnTriggerEnter(other : Collider)
{
if(other.CompareTag("FlameThrower"))
{
Debug.Log("Getting Flamethrower");
BroadcastMessage("SelectWeapon",0);
}
if(other.CompareTag("MachineGun"))
{
Debug.Log("Getting Machine Gun");
BroadcastMessage("SelectWeapon",1);
}
}
Each weapon model floating around my scene has the appropriate tag (MachineGun or FlameThrower). However, even when I run into a model, nothing is ever printed out.
All of the models have a mesh collider and are set to Is Trigger.
Anyone have any idea why these triggers aren’t being set off?