how do I make an Instantiate function with 4 parameters

I am trying to make an Insatiate Function but it isn’t really working it is suppose to make an platformer spawn but there is an error saying: Cannot Convert From ‘(int, int, int)’ to ‘Transform’

for (int i = 0; i < objectCount; i++)
            Instantiate(prefab2, position, Quaternion.identity, (0, -Height, 0));
            position.x += spacing;

>Solution :

If you take a look here:
at the Declaration it says:

public static Object Instantiate(Object original, Vector3 position, Quaternion rotation, Transform parent);

The fourth argument you have is (0, -Height, 0) which is (int, int, int).
But it wants a Transform. (The Transform of the Parent it should have)

I dont know what you want with (0, -Height, 0), maybe you could clear up?

Leave a Reply