Getting point from destroying asteroids?

I’m trying to make it to where you can shoot asteroids and get points, but not of the tutorials make sense. Here’s a couple of my scripts.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class Asteroid : MonoBehaviour
{
    private Rigidbody2D rb2D;
    private float revSpeed = 50.0f;

    void Start ()
    {
        rb2D = gameObject.GetComponent<Rigidbody2D>();
        Destroy(gameObject, 10);
    }

    void FixedUpdate ()
    {
        rb2D.MoveRotation(rb2D.rotation + revSpeed * Time.deltaTime);
    }

    void OnCollisionEnter2D(Collision2D other)
    {
         if(other.gameObject.tag == "Player")
         {
             SceneManager.LoadScene(0);
         }
     }
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ShipControl : MonoBehaviour
{
    public GameObject shotPrefab;
    public Transform shotSpawn;

    public float moveSpeed = 300f;
    private Rigidbody2D shipHull;

    private float screenWidth;
    private float screenHeight;

    public Vector2 newPosLeft;
    public Vector2 newPosRight;

  
    void Start ()
    {
        screenWidth = Screen.width;
        screenHeight = Screen.height;
        shipHull = gameObject.GetComponent<Rigidbody2D>();
        newPosLeft = new Vector2(-3.0f, -2.8f);
        newPosRight = new Vector2(3.0f, -2.8f);
    }

    void Update ()
    {
        int i = 0;
        while (i < Input.touchCount)
        {
            if (Input.GetTouch(i).position.x > screenWidth / 2)
            {
                MoveShip(2.0f);
            }
            if (Input.GetTouch(i).position.x < screenWidth / 2)
            {
                MoveShip(-2.0f);
            }

            if (Input.GetTouch(i).position.y < screenHeight * 0.15f)
            {
                Fire();
            }
            ++i;
        }
    }

    void FixedUpdate()

    {
        #if UNITY_EDITOR
        MoveShip(Input.GetAxis("Horizontal"));
        if (Input.GetKeyDown(KeyCode.X))
        {
            Fire();
        }
        #endif
    }

    private void MoveShip(float horizontalInput)
    {
        shipHull.AddForce(new Vector2(horizontalInput * moveSpeed * Time.deltaTime, 0));

        if(transform.position.x > 3.0f)
        {
            transform.position = newPosRight;
        }

        if(transform.position.x < -3.0f)
        {
            transform.position = newPosLeft;
        }
    }

    void Fire()
    {
        var shot = (GameObject)Instantiate(shotPrefab, shotSpawn.position, shotSpawn.rotation);

        shot.GetComponent<Rigidbody2D>().velocity = shot.transform.up * 6;

        Destroy(shot, 2.0f);
    }
}

Should I edit these, or will I need to make a new script enterly?

See how the asteroid checks if it enters the player and then loads scene 0 to game over? You will need something like that for the shots, assuming you’re going to use physics.

An alternate approach is to keep a list of shots and have the asteroids ask if any of them have gotten close enough to destroy it. I prefer this approach, but nothing wrong with the physics-based approach.

If you want to do this there really isn’t a way around understanding scripting. This forum is about helping folks who are genuinely trying to understand scripting, not just posting random scripts and asking if more typing might be needed.

I highly recommend starting with simpler tutorials, such as perhaps the roll-a-ball type things, or anything that you can do and actually fully understand. If you don’t understand something, stop and go back until you do.

If you want an example of a twin-stick shooter that actually uses coordinate comparisons and does not use physics, you’re welcome to take a look in my proximity_buttons repository at the DemoTwinStickShooter.unity scene. The collision checks and scoring are handled in the TwinStickGameManager.cs, inside of the CheckBulletsAgainstEnemies() function.

proximity_buttons is presently hosted at these locations:

https://bitbucket.org/kurtdekker/proximity_buttons

https://github.com/kurtdekker/proximity_buttons

https://gitlab.com/kurtdekker/proximity_buttons

https://sourceforge.net/projects/proximity-buttons/