trouble making a fast projectile

Hi everyone, I made a bullet using linecast in a 2.5D space shooter game, however it has a problem when the collider hits the bullet before the bullet hits the collider, so the linecast ignores the collider from the starting point and finally does not collide.

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

public class BulletScript : MonoBehaviour
{
    public WeaponScript Owner;
    [HideInInspector]
    public Vector2 FireSpot;
    public string Team;
    [HideInInspector]
    public Vector2 LastPosition;

    public float BulletSpeed;
    public float Pierce;

    void Start()
    {
        LastPosition = transform.position;
    }

    void Update()
    {
        transform.Translate(FireSpot * BulletSpeed * Time.deltaTime);
        if (Physics.Linecast(LastPosition, transform.position, out RaycastHit HitInfo, LayerMask.GetMask("Hittable")))
        {
            Hit(HitInfo.collider, HitInfo.point);
        }
        LastPosition = transform.position;
    }

    // for subsequent hits
    public void PostHits(Vector2 Start)
    {
        if (Physics.Linecast(Start, end: transform.position, out RaycastHit HitInfo, LayerMask.GetMask("Hittable")))
        {
            Hit(HitInfo.collider, HitInfo.point);
        }
    }

    public virtual void Hit(Collider other, Vector2 Point)
    {
        if (other.GetComponent<RPGBasicScript>())
        {
            if (other.GetComponent<RPGBasicScript>().Team != Team)
            {
               // { damage calculations }

                if (Pierce > 0)
                {
                    Pierce--;
                    PostHits(Point);
                }
                else
                {
                    Destroy(gameObject);
                }
            }
        }
    }
}

I need a faster projectile that the rigidbody supports and that penetrates enemies, I tried to change the order of the scripts but without success, thanks to all.

When you say you need a faster projectile than rigidbody supports do you mean you are hitting physics tunneling errors? (Object is moving so fast that it can travel the entire distance of an object in a frame and thus not be in collision with it even though its path took it through the object?)

If that’s the case you might try setting your Rigidbody Collision Detection mode to Continuous Dynamic (or if you are using a kinematic rigidbody use Continuous Speculative). These collision modes are more expensive which is why they do not default, but they account for the tunneling problem. still counting a collision at the correct point even with fast-moving colliders.

Then you could just use OnCollisionEnter to detect the collision.

I just tested using OnTriggerEnter with Continuous Dynamic on the bullet and on the enemy, but above 100 speed the bullet ignored some enemies on the way hitting the last one without hitting the first one.