Collision detection

Hey, don’t understand why this isn’t working. It seems to be fine to me plus there are no errors but it won’t do as it’s supposed to!

Basically once the object the script is attached to detects a collision with another object with a tag “Arrow”, then it should destroy the arrow but all that is happening is that the arrow keeps following the object.

public class Enemy1DestroyScript : MonoBehaviour {
	

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	void OnCollisionEnter(Collision collision)
	{
		if(collision.gameObject.tag=="Arrow")
		{
			Destroy(collision.gameObject);
		}
	}
}

Shouldn’t it be OnCollisionEnter( collision : Collision) ?

It’s in C# so I don’t think so should it?

Maybe not, I don’t know. I’m really bad at scripting but yeah.

Nevermind I got it :slight_smile: