Okay, so I want to parent ObjectA to ObjectB. ObjectB is moving wherever the mouse is. I found this script:
import Rasterizer as r import GameLogic as g c = g.getCurrentController() o = c.getOwner() mouse = c.getSensor("mouse") move = c.getActuator("move") wx = r.getWindowWidth()/2 wy = r.getWindowHeight()/2 mx = mouse.getXPosition() my = mouse.getYPosition() x = 0.005 move.setDLoc((mx-wx)*x,(my-wy)*-x,0,0) g.addActiveActuator(move,1) r.setMousePosition(wx,wy)
Now the only problem is that it only works for top view (because it is only x and y axis. Is there a way to change this to X and Z position? Z being up and down and X being left and right?
I tried mouse.getZposition but soon after I found out this is not a command.