So I have 2 objects, one a player and another an enemy. I have a script attached to the player as follows
void OnCollisionEnter (Collision col)
{
if(col.gameObject.name == "prop_powerCube")
{
Destroy(col.gameObject);
}
}
I have a sphere collider attached to the player and a mesh collider attached to the enemy. I have already setup the variable Checkcollision to appear on my debug log and for it to increase by 1 every time the player collides with the enemy. The problem is it won’t increase by one.
To try to fix this problem I attached this script to the enemy
void OnCollisionEnter (Collision col)
{
}
My player has a rigidbody component attached to it but my enemy does not. I did not click the “Is Trigger” checkbox on both colliders as well.
Thanks
I'm only using default character motor and fpsinputcontroller
– Vylax