Okay, so I got my player controller colliding with an object that I want to pick up, and it does collide with it, but in the pick up item's script it is set to delete itself upon collision and does not, and with a Debug.Log I found out that even though the player is colliding with it physically, it isn't... not sure how to say it but it doesn't output anything when I type Debug.Log(collider.gameObject.tag); when the player is tagged as Player. And I know the debug.log works because the bullets I shoot at it output an "Untagged" in the console.
I'll reference some code:
function Start()
{
//Physics.IgnoreLayerCollision(10, 11, true);
//Physics.IgnoreLayerCollision(9, 11, true); //commented out for debugging
//Physics.IgnoreLayerCollision(11, 11, true);
}
function OnCollisionEnter(collision : Collision)
{
Debug.Log(collision.gameObject.tag); //<--- this outputs nothing when the player hits it
if (collision.gameObject.tag != "Player")
return;
Inventory.AddItem(item);
Destroy(gameObject);
}
I also tried making it collide with other random objects and they also don't seem to pass a .tag value, so it seems the only thing that can collide with this object is a bullet.
Edit for statement:
function OnControllerColliderHit (hit : ControllerColliderHit)
{
var body : Rigidbody = hit.collider.attachedRigidbody;
Debug.Log( hit );
Debug.Log( body );
}
Both debugged nothing to the log.