Tagging a collider and destroying it

void OnCollisionEnter(Collider other){
if (other.gameObject.tag == “Player”) {
Destroy (other.gameObject);

here is my collision script I am making a fps multiplayer game and this is the script for destroying the other player when that player is hit

I have tagged the player

For starters, OnCollisionEnter takes in a Collision, not a Collider, so just replace Collider with Collision.

Does that fix your problem?

Note: It’d be better to use:


because comparing strings with equals signs don’t always work correctly.