Member-only story
Making a RTS game #38: Using workers to construct buildings 3/3 (Unity/C#)
Today, let’s finish refactoring our RTS construction process!
⬅️ Tutorial #37: Using workers to construct buildings 2/3 | TOC | Tutorial #39: Boosting our game scene ➡️
📕 Get the ebook and bonus material on Gumroad!
🚀 Find the code of this tutorial series on my Github!

In the last two episodes, we worked on refactoring our building construction process so that, instead of placing them instantly on the ground, we have Worker character units build them gradually, over a short period of time.
So far, we’ve done the core logic and we’ve improved the visual a bit by having the building change shape throughout construction and even adding some VFX. Today, we’ll wrap this up by adding sounds and tweaking a few variables.
Replacing the basic ratio with a per-building construction time
Up to this point, we’ve been working exclusively with 0–1 ratios. It was nice because it made it easy to evaluate whether a construction was finished, en route, what kind of mesh we should be showing, etc.
However, it is sort of limiting for a real game. In particular, it means that no…