- Home /
Placing 2D Tiles randomly
I am a beginner and want to build a 2D game where the player has to jump up a tower. I have a platform that is a 2D tile. Know i wanna know if its possible to place the tiles randomly in the game so everytime the player dies the tower is different generated. ,I am a beginner and want to build a 2D game where the player has to jump up a tower. I have a platform that is a 2D tile. Now i wanna know if its possible to place them randomly in my game so every round the player plays is different.
Answer by Revolution_Game · Apr 01 at 02:05 PM
maybe something like this?
void Start(){
float x = Random.Range(0f,100f), y = Random.Range(0f,100f);
tile.transform.position = new Vector2(x, y);
}
if this isn't what you are looking for try specifying your question. https://docs.unity3d.com/ScriptReference/Random.Range.html
Your answer
Follow this Question
Related Questions
2D Animation does not start 1 Answer
Making an array for Texture2D?? 2 Answers
How to create an event for a specific role on a tilemap. 0 Answers
Others can't jump in my game 0 Answers