Player health script doesnt work?

Yo.
I made a player health script and an enemy bullet script…
I have an enemy script and a normal bullet script too and there the damage works perfectly.
But for whatever reason the nearly exact same scripts are not working on the enemyBullet and the player scripts, so what i mean is that the player doesnt get damage although he has the proper script…
Can somebody help and tell me what is wrong?
There are two screenshots attached with the enemyBullet and the player script :wink:


Have you set the damage value in the EnemyBullet script in the editor?

Careful, you have two different “player” variables in your bullet script, this is never a good idea. Also make sure that your collision layers are correct and that your bullets are actually detecting the collisions. I suggest adding a Debug.Log(hitInfo.gameObject.name) just to make sure the collision is actually being triggered. If its not then likely either your collision layers are off (check under the physics settings to see the collision matrix), or your bullets are traveling too fast to trigger a collision (raycasting between bullet positions is a common way to fix this issue for fast-moving projectiles)