2D Click makes object on 3D scene?

Ok i have my test scene set up now, its a building and i implemented (found) a simple script which shows the mouse when the simulation is running, is there anyway to make that pointer be able to click and create (bombs) on the 3D structure where the mouse clicks?

The only thing i can think of is to have some sort of first person view (so the centre of the screen is the view) and then have the bomb object which is located and rotated to the same as the 3d camera’s position. Which then shoots away in the direction the viewpoint is facing and stops dead when/if it encounters an object. Although i’d prefer windows mouse clicks.

Given that the first option is more what i want, but sounds more complicated given my past (and limited) experience of blender, it leaves me with this question: How could it be done?

Given that the second option likely involves slightly less maths, it leaves me with these questions:

How does create an bomb object (in game) and position+rotate it to be in the same space and direction as the camera?

How does one then (i.e. only after the bomb is created), make it fly away from the player (instantly, it should just appear on the object to the player).

How does one get said object to stop once it does encounter physical matter (without psysically using force and upsetting the 3d object)?

PS: Check out the attached file for a look at the test file (complete with working spacebar bomb!). You may need to add a script called “showmouse.py”


import Rasterizer

and add it to the blend, as i dont know if it added itself!