Ok, so I keep getting the error: UnityException: Tag: Projectile is not defined!
void OnTriggerEnter(Collider collider){
if (collider.gameObject.CompareTag("Projectile")){
Destroy(this.gameObject);
Ok, so I keep getting the error: UnityException: Tag: Projectile is not defined!
void OnTriggerEnter(Collider collider){
if (collider.gameObject.CompareTag("Projectile")){
Destroy(this.gameObject);
1.Select Object
2.Go to Inspector > Tag > Add Tag >Tag
3.Set Size , Enter “TagName”
4.Click on object to add tag
5.Go to Inspector > Tag > “TagName”
To add a tag. You can do it in the editor. Select the object and right above the transform component, yOu will see tags and layers. They both have dropdown menus and you can select add new layer or edit tag or something rather. After selecting that, you will see the list of tags and layers. Add your tags there and set them from that tag dropdown menu above the transform or by code gameObject.tag = “Tag Name”;