issues with other.gameObject.SetActive(false);

I’m following the Space Shooter tutorial but I’m trying to change the script for the explosions to just collecting the Asteroid.
I have no errors in the script but the Asteroid does not disappear with it Collides with my spaceship and the score keeps adding points soon as an Asteroid comes into frame.

If anyone can provide me a hint on where I am wrong please do let me know!

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Collect: MonoBehaviour
{

public int scoreValue;
private Done_GameController gameController;

void Start ()
{
	GameObject gameControllerObject = GameObject.FindGameObjectWithTag ("GameController");
	if (gameControllerObject != null)
	{
		gameController = gameControllerObject.GetComponent <Done_GameController>();
	}
	if (gameController == null)
	{
		Debug.Log ("Cannot find 'GameController' script");
	}
}
void OnTriggerEnter (Collider other)
{
    //Check the provided Collider2D parameter other to see if it is tagged "PickUp", if it is...
    if (other.gameObject.CompareTag("Enemy"))

    //... then set the other object we just collided with to inactive.
    other.gameObject.SetActive(false);

			gameController.AddScore(scoreValue);

    //Add one to the current value of our count variable.
		}

	}

Good day.

You need to detect “strange things”.

Look at line 25, you see the code is moved to right? this is because there is something strange, your scripting program detects something is wrong with “squematic” symbols like ( ) or { } or

So if you check it will see your if sentence from line 20 have nothing inside, because you did not put any “{…}”

And the code thinks the lines 24 and 25 are not inside that if…

Good bye!