How to write a Python Program to Blender 3D Game - Move Object with Mouse - Drag & Drop ?
Solution:
import bge
cont = bge.logic.getCurrentController()
owner = cont.owner
mouse = cont.sensors["movement"]
width = bge.render.getWindowWidth()
width = width/2
height = bge.render.getWindowHeight()
height = height/2
pos = mouse.position
posX = width-pos[0]
posX = posX*0.03*-1
owner.localPosition.x = posX
posZ = height-pos[1]
posZ = posZ*0.03
owner.localPosition.z = posZ
print(posX)