Coding for a simcity like game

I can’t find any tutorials on how to code for a game that does not involve fps or does not involve characters and action.

I’m trying to make basic clicks, drop, money system for my simcity like game. I need to know what kind of codes i need and how they should look like. I have little experience in coding in unity so try to keep it simple.

I need to click a gui and pop up a window with list of game objects to build. when i click on the game object, i want the mouse to turn into the building or whatever i clicked on and then drop the object into the terrain when i click on that part of the terrain.

i need a money system to calculate the cost of the buildings also.

for now, these are the two scripts. please help me or direct me to a tutorial that will provide me with help! I would appreciate it.

I happen to be working on a city builder game and I can tell you that without a extremely solid foundation in programming you should start at something more basic. C# is one of the easiest languages to code in and Unity has an extremely large pool of tutorials out there. Getting familar with how Unity handles objects and components is the first place to start.

So tutorials to focus on initially are components, GUI, and general scripting… This should give you an idea of how to tackle the bigger picture.

1 Like

I had a play with “placing buildings”… good start is learning to “instantiate” prefabs and learning how to use "raycast"s to work out where the mouse is clicking. Then you need to put the two together and put in a plane and place a prefab when you click.

Then you’ll be looking at "array"s to get a container full of different buildings to place and the OnGUI functions for an interface to select the building to place.

They’re going to be the tricky learning bits, adding in a cost per building and a player script to keep track of the funds is relatively easy.

1 Like