instantiating objects on parabola

Hi all, i’m making another infinity “temple run”-like running game.
I’m instantiating coins prefabs in a row easely:

GameObject[] boolArray = new GameObject[]{ silverCoin, copperCoin, goldCoin };
					for (int step = 0; step < 14; step+=2) {
							GameObject clone = (GameObject) Instantiate (boolArray[(Random.Range(0, boolArray.Length))], transform.position, transform.rotation);
							clone.transform.position = clone.transform.position + transform.forward * step;
							clone.name = "coin";				
					}

i’d like to know how to instantiate’em this way:
1226398--51174--$parabola.jpg
don’t look at the numbers and imagine mario is a coin))).

Is there any math guru who can give me some advice?

You ll need Sin() or Cos() so sinus or cosinus forgot which one does what.
Look them up in the reference.
Not really math guru talk but hope it helps.

Yes, i know i’ve got to digg in this direction, but need some more hints:(

I m on mobile atm or i would look it up for you. But just google sinus and cosinus. Wiki gives a good explenation.
I think you x is the point the parabol starts and y the the top of the parabol.
Im not really good at this stuff. Mostly do some math research and then find the right calculation thru trail and error.

Technically not quite right, sin and cosine give curves that are related to the circle. Parabolas are from the y = x^2 function and accurately represent gravity (so if the coins are to be grabbed in a jump, that’s what you want…they’ll spread out over the jump and fall curve).

That said, sin and cosine are very very handy functions to understand and can be used for all kinds of smooth interpolation etc. And in this case they may give you a perfectly good result, just try it and see…!

How to implement? You need a “domain” (x or horizontal) and a “range” (y or vertical) and the function which connects them (sin, cosine, x^2). Once you get the minimum and maximums of x and y figured out, you should be all set…you can plug in values for x that are separated linearly (like 0.1, 0.2, 0.3, using a for loop) and your y-values will respond to the function you choose.

Try this awesome graphing calculator and see what the different functions do:

https://www.desmos.com/

thanks for the correction james, what an awesome site!!!