Mina Pêcheux
1 min readFeb 7, 2022

--

Hi — happy to know you’re interested in the tutorial :)

What could be happening is that you are instantly placing the “phantom” building a first time when you click on the building,

  • either because you are checking for clicks “too soon” (for example on the GetMouseButtonDown() instead of GetMouseButtonUp())
  • or perhaps because you are not properly blocking the UI clicks (with the EventSystem.current.IsPointerOverGameObject())?

This second point is explained in more details in the 2nd tutorial (https://medium.com/codex/making-a-rts-game-2-adding-a-very-basic-ui-unity-c-8420480afda0), or you can also check out the code on Github directly if you want… it’s evolved quite a lot since the first tutorial, but this part of the logic is still pretty similar ;)

Hope it helps, cheers! :)

--

--

Mina Pêcheux
Mina Pêcheux

Written by Mina Pêcheux

I’m a freelance full-stack web & game developer. I’m passionate about topics like CGI, music, data science and more! Find me at: https://minapecheux.com :)

No responses yet