I am doing a game, like a Breeding Frog Game.
(example: Cow evolution + Dragon city)
I don’t know how to do it, first I am making the Frog’s movement, they have to move in random direction.
But this is not really easy, and i didn’t found any Help about it.
My idea is to Create a grid… on this Grid, an invisible Object will spawn.
The Frog will go to the Object’s position, and after 4 to 7 seconds, the Objesct will desapear, and another one will spawn. etc …
So please help ^^ !
I would first create an vector2, then define the values like this:
position vector2(mathf.ceiltoint(random.range(xMin,xMax),mathf.ceiltoint(random.range(yMin,yMax));
You can instaniate it then, the “grid” as you call it would be in 1x1 blocks, the 5-7 seconds rule could either be done trough an invoke paired with an destroy after the given time.
The other option would an IEnumerator with an yield return new waitforseconds that destroys and calls the generation again
Note that the upper code probably has some typos in it, just play around.