click and drag objects in game engine?

Has anyone made a python script to control the x,y,z location of of objects that you mouse click on and drag ?

please
have you repons ?

Yeah, it’s easy:

controller = GameLogic.getCurrentController()
owner = controller.owner
import Rasterizer
Rasterizer.showMouse(1)
if controller.sensors["over"].positive and controller.sensors["click"].positive:
    object = controller.sensors["over"]
    owner.position = [object.hitPosition[0],object.hitPosition[1],owner.position[2]]

Then on the object to be dragged, add two mouse sensors, one a mouse over not “mouseover any”, call it “over” make it true pulse.
the other one is a left click, call it “click”

what about for dynamic objects?