Handling colliders on hundreds of asteroids (not procedural asteroids) ...URGENT

I have 480 asteroids in my scene .
it is not a good idea to add colliders to every single object so I wrote a little script that takes in the distance of the asteroid from my ship and turns the individual asteroids collider off when it is too far from the ship,

but this process is slow.

I figure that the method i use to calculate Distance is too slow.

this is a standalone build and it can run up to 70 FPS but when the asteroids are in the scene it can fall to as low as 15 FPS .

        public  MeshCollider _MeshCollider; 
	public  MeshRenderer _MeshRenderer;
        private GameObject myPlayer;
private Float Distance;


	void Start()
	{
		
		_MeshCollider = gameObject.GetComponent<MeshCollider> ();

		//-----------------------------------------------------------------------------------------------------
		_MeshRenderer = gameObject.GetComponent<MeshRenderer> ();

			}



void Update ()
{


if(! myPlayer)
{
 myPlayer = GameObject.FindWithTag("myPlayer"); // wont eat up MS too much when called once

Distance = Vector3.Distance(myPlayer.transform.position ,gameObject.transform.position);


//-------------------------------disable collider over distance using player distance-----------
		if (Distance < 100) {
			if (_MeshCollider.collider.enabled == false) {
				_MeshCollider.collider.enabled = true;
						}
			_MeshCollider.convex = true;
				} 

		if (Distance > 100 && ShipDistance < 1000) {
			if (_MeshCollider.collider.enabled == false) {
				_MeshCollider.collider.enabled = true;
						}
			_MeshCollider.convex = false;

				}
		if(Distance > 1000) {
			_MeshCollider.collider.enabled = false;
				}

			//-------------------------------------------------------------------------------------- 


}

}

is there another way to allow eaach asteroid to take collisions and without slowing down the whole game .

my method works but it is too slow.

You could use Physics.OverlapSphere (https://docs.unity3d.com/Documentation/ScriptReference/Physics.OverlapSphere.html) on your player.

The radius of the sphere would be the max distance you want for your asteroid colliders. Everything the sphere detects would have it’s collider turned on. You could have this run once a second or something to reduce the amount of calculations. You still might be in for a lot of calculations though depending on how many asteroids are nearby.

Since you’re OK with colliders turned off, I’m assuming asteroids can
go through each other (like the game.) Some things to try:

o Use sqrMagnitude in the distance calculations (very minor speed-up.)

o replace Mesh colliders with Sphere, or compound.

o As Ostego writes, do the math once/second. Or, better check 10 asteroids/frame
(so each asteroid gets checked about 1nce/sec.)

o Try it without this – colliders always turned on. Is that really so slow?

o Same as before – colliders always on. But put them all on a layer that
doesn’t hit itself, but can hit the player.

o Use the giant trigger sphere around the player trick. Where enter/exit
flips collider status.

o Instead of flipping colliders, set too-far asteroids to inactive.

Ultimately , it is slower to be switching between convex and non convex meshes at runtime , especially in this case , so i just left the mall as convex and toggles their renderer and collider state depending on distance . Sqr magnitude would be a bit faster but it is fine as is now.