Reputation: 39
I have visited many forums for this problem and I have searched lots of tutorials for this issue. Here's my code :
private void OnTriggerEnter(Collider collision)
{
GameObject collisionGameObject = collision.gameObject;
if (collisionGameObject.name == "playerBullet")
{
Debug.Log("damage taken");
TakeDamage(40);
}
}
I should be doing everything right, what went wrong?
Upvotes: 0
Views: 35
Reputation: 2598
Make sure of the following things:
Upvotes: 1