I'm working on a 2d endless runner (think Jetpack Joyride or Wind runner)
I'm going to make a few different types of coins for the player collect each with a unique value to the score and to the currency.
I'm using tilemaps to do both the coins(and other collectibles) and the map. Each time the player pass a certain point in the map a new one chosen among the avalible maps to be created.
The problem is I can't make the type of the coins that spawn on each level to be randomized. I tough that making a variable that would be randomized (using chose(1,2,3...) so that the value was always an Int would be the best way.
I'm using a function to create each level and when i try to add the condition check to see what type of coin is going to appear they just vanish.
Using the debug i can see that the variable is being changed but the verification and the creation of the object seems to be skiped.
I'm using a count variable to create the tilemaps, in wich the position they have to spawn in the level count * the size of the layout
The level count is another problems, altough for the plataforms and scenario it works it wont increase by 1 even tough the only time its suposed to increase is when the player collides with the trigger, and I disable the collision rigth after it, it increases buy 2 or 3 every step. the map stil spawns on the rigth place that is just the amount i see it increasin in the debug mode.