Object not instantiating while simmilar object does

I have got a call to this method from a start method for one of my game objects.

public void createFirstPlatforms()
{
    Debug.Log(-(basicHeight / 2));
    GameObject a = Instantiate(PrePlatform, new Vector3(0.001f, -(basicHeight/2), -1.160699f), Quaternion.identity);
    a.name = "Annoying_Platform";
    Debug.Log(a.name + ", In position" + a.GetComponent<Platform>().GetPosition()); // GetPosition is return transform.poistion
    GameObject b = Instantiate(PrePlatform, new Vector3(10.34f, 0.1215f, -1.160699f), Quaternion.identity);
    b.name = "Good_Platform";
    Debug.Log(b.name + ", In position" + b.GetComponent<Platform>().GetPosition()); // GetPosition is return transform.poistion
}

PrePlatform is a prefab that I have stored. I know for a fact it works as I instantiate it many more times without issue. the platforms are created with the same Z position and nothing blocks them in the position of the bad platform.

The second instantiate is working as expected but for some reason, the first one does not work when the scene starts, however, it does work when the method is called again in a restart method.

I don’t understand what events could cause it so the first Instantiate wouldn’t work when the second one does.

Using the log(image below) I know that the first platform is being Instantiated and it seems to be in the right place but it does not appear.
154786-log-screenshot.png

I changed my player (the object that steps on the platforms) collision to be continuous instead of discrete (it shouldn’t have been discrete in the first place, that was my bad) and from now on the platform Instantiates without a problem.

@Nimi142 , PrePlatform is a prefab? Verify whether or not it is actually working by getting a reference to each:

GameObject go1 = (GameObject) Instantiate(PrePlatform, new Vector3(0.001f, -4f, -1.160699f), Quaternion.identity);
go1.name = "go_1";
Debug.log( go1.name);

Do that for the second one too and use a different variable and different name. I bet you will see the Debug for each printing the respective names. If so, it means both are getting instantiated and your 1st gameobject is not where you expect it should be…

P.S. no need to cast your floats ‘(float)’ if you use ‘f’ after the number - you should after the ‘-4’