0
\$\begingroup\$

I'm fairly new to C# and Unity, so I don't really know much about it.

I want to create an RTS like game where you have a huge grid that the whole world is placed on. Then you can place houses, walls etc on the tiles just like a lot other RTS games (i.e. Age of Empires, Stronghold Series etc).

How would I go about this in Unity? I could imagine having some Terrain/World manager that handles all the models and objects that you can interact with etc. And probably a lot of prefabs too with the different items, soldiers and so.

So if anyone have any smart way of doing this or maybe a link to a tutorial explaining, then the help would be greatly appreciated.

\$\endgroup\$
2
\$\begingroup\$

You don't exactly need a grid actually. If you don't need to get information back from tile, you can create a fake tile illusion by "snapping" objects to certain floating points.

For instance, say, you want to have a grid that has placement points on 0, 1, 2, 3 and 4.
Then when the object is at 0.3f, you round it to 0;
and when it is at 0.7f, you round it to 1 (etc.).

This way you will create a snapping effect that gives illusion of a grid.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.