W
W
Wadim_wadim20002020-07-01 14:04:51
Unity
Wadim_wadim2000, 2020-07-01 14:04:51

How to make "coins" from tiles?

I would like to know how to make coins for the game from tiles. I just have coins in the game that are approximately the same as in Tomb of the mask, there are a lot of them. The question is how to make them in the form of tiles, so as not to arrange them manually? Can you post an example? Or is there another way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zZaKko, 2020-07-01
@Wadim_wadim2000

Create a script, create a prefab for a coin with assets, calculate the position where you need to start placing them and what the difference in distance should be between 2 nearby coins. And in start() loop through them at the starting position, each time changing it to a distance. This will be much more automatic:

public GameObject coin;
public Vector3 start_pos;
public float outline;
public int c;
void Start(){
for(int i = 0; i < c; i++){
Instantive(coin, start_pos, Quaternion.identity);
start_pos.transform.position += new Vector3(outline,0f,0f);//Или изменяешь по y или z.
}
}

If I understand you correctly, this is my solution))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question