Hi,
I had a look around in the previously posted questions but couldn't find an answer... (Sorry if there is one already :/).
Anyway, I have a terrain, and an orthographic view of it with my main cam. On a part of this terrain, I would like to create a Tower Defence game.
I am able to create an object on a mouse click using a raycast, but: This method allows to create 1000's of objects at the same location, while I would like one object only, and any further attempt to be blocked if it collides with a similar object.
All my attempts at using collisions (script attached to the prefab of the object, using OnCollisionEnter or OnTriggerEnter) failed.
Decided to try an other route, which would be to use a grid of this "game area" and store in an array the state of every cell of the grid, so haveing the mouse snap to the grid and then check if the cells are already in use by an object or not (not sure exactly how to create that grid though).
Any way, does anyone have suggestions regarding which method would be best, and a bit of code to get me started please?
Thanks in advance!