Real Time Strategy game


I need to find a way to get my mouse cursor to spawn (add object) where I last clicked with the mouse on a plane/terrain.

*Requirements: made only with logic bricks (if possible).

I think you need logic to handle the mouse input, and then you can use that to shoot a ray, and use the ray strike point as a target, then have the target fed back to a property,
(see the simple .blend @ the bottom)

next placement is going to require a volume check to see if there are any other structures/ placed items in the area you are trying to place, you can do this with a cube spawned on “Sensor” for a frame or two. if it collides have it say it did

in “cursor”
Mouseclick left--------------------------------and-------------------------------------add object “Collision cube”

“Collision Cube”

Collision “Property label”---------------------and---------------------------------------message to cursor “don’t place”
___________________________________-----------------------------------------End object “Collision cube”

delay------------------------------------and------------------------------------------message to cursor “it’s ok to place”

you will need a menu to decide which “collision outline” to place for each structure and then to place the structure when the “volume check” is passed

Thank you very much ! Just what I needed.