I am trying to procedurally generate a scrolling game. The first thing I want to do is generate a line of tiles for a flat floor and ceiling. Then I want fill the space in between with a grid of different tiles.
I have almost no Unity experience but I have a strong programming background. It is fairly simple to initialize an array with values but I don’t know how to do this in Unity. I have a tile set from the asset store and don’t know what to do with it.
Do I have to make a prefab and make a script to populate an array? Is there something special I can do in 2D mode?
Any pointers in the right direction would be helpful (or a high level description of what to do)!
Look into Instantiation() - This would require a prefab. Instantiation(YourPrefab, YourSpawnposition.transform.position, Quanternion.identity) - Note - Identity is a default rotation for your prefab. If you wish for a different rotation, you can utilize Quanternion.Eulers(0,0,0) but make them as you wish.
Whether you’re scrolling up or down, left or right, you can do this by adding a RigidBody2D to an empty game object and applying a velocity to it. (GameObject.velocity = Vector2.up)