Hello Everyone!
I am making a city game about creating a city and keeping it at stable stage. I am currently working on a shop system where you can buy buildings to place but i am having some trouble with the placement system and so i came on here for some help. How can i make a game-object follow my cursor?
raycast would work, it shoots ray from mouse position to the world, and if there is collider (in the ground for example)
you get the hit point, where you can then set your objects position:
example
I have a problem with it, when there are bigger objects, the object moving with the cursor is off by a lot. Is there any way to fix this?
Fixed this problem, something with the camera