How do I slow down the frame rate?

I have been following this tutorial, Unity Endless Runner Tutorial #4 - Generating Infinite Platforms - YouTube, to learn how to spawn an infinite amount of platforms. My game is 3D while the tutorial is 2D, yet I have been able to use the same code. However, my issue is that too many platforms are being spawned before my player can even go very far, making my unity crash easily. One platform is being spawned each frame so I have tried slowing down the rate. Yet even at a TIme Scale of .25, and speeding up my player, platforms are still being spawned pretty fast and it doesn’t run smoothly. Also, in my code, I’m saying that if the most recent platform’s position is less than another point (platformGenerationPoint) in front of it, then spawn another platform. But at one point, the platforms would surpass that point, yet they are still being spawned. I honstly don’t even know what to ask because I’m just totally lost. I’m sorry that this is not explained well, and feel free to ask for more information. I’m still a beginner at unity. I also don’t know why my code is being shown like that:/

using UnityEngine;
using System.Collections;

public class PlatformGenerator : MonoBehaviour
{
public GameObject thePlatform;
public Transform generationPoint;
public float distanceBetween;

private float platformWidth;

// Start is called before the first frame update
void Start()
{
	platformWidth = thePlatform.GetComponent<BoxCollider>().size.x;
}

// Update is called once per frame
void FixedUpdate()
{
	if(transform.position.z < generationPoint.position.z);
	{
		transform.position = new Vector3(transform.position.x, transform.position.y, transform.position. z + platformWidth + distanceBetween * Time.fixedDeltaTime);
	
		Instantiate (thePlatform, transform.position, transform.rotation);
	}
}

}

Ok, this isn’t a frame rate issue. It is a spawning overkill issue. At the moment, every frame that the condition that checks if the transform position on the z axis is less than the generation position, you spawn a new platform.

 bool platformSpawned = false;

void FixedUpdate()
 {
     if(transform.position.z < generationPoint.position.z && !platformSpawned){
platformSpawned = true;
//do your stuff

}}

@highpockets Thank you soooo much for the fast response! It’s very much appreciated! If it’s not too much of a bother, I have a few more questions. What exactly do you mean by “do your stuff”? Where should I put in Application.targetFrameRate = (1.0f / Time.deltaTime) * 0.5f;? Also, none of my platforms are being spawned. Thank you for the help already though!

I could never thank you enough @highpockets! I promise that this is the last question. How do I loop my code in the FixedUpdate? This is my current code:

void FixedUpdate()
{

	if (transform.position.z < generationPoint.position.z && !platformSpawned)
	{
		platformSpawned = true;
		{
			transform.position = new Vector3(transform.position.x, transform.position.y, transform.position. z + platformWidth + distanceBetween * Time.fixedDeltaTime);
			Instantiate (thePlatform, transform.position, transform.rotation);

		}
	}
}  

So I found out that this works great (thanks to your help)! The only thing is that only one platform is being spawned. Though if I were to instantiate the platforms multiple times, it would spawn right where I want. Is there a way to loop the code? I’m not too familiar with loops and the videos I saw didn’t help much either. Thank you once again!

@highpockets So I would like to have the platforms to spawned infinitely since my game is like an endless runner. I’m thinking like 2 platforms each frame. Thank you once again!

@highpockets Thank for you help once again! I got so much progress on my game because of you. You taught me a lot too and I’m very grateful. I’ll definitely check out the code and see how it works with my game.