indent error

no idea why this is causing an error


basically I want the sphere to always follow the mouse…no matter how fast/slow the mouse is moving

theres a few things wrong, first of all: wrong section. this is game engine, not bpy.

secondly, please refer to the python api for what modules are available. (try: bge.render instead of Rasterizer)

third, the mouse position is already normalized screen coordinates, so you dont even need the render module for the screen resolution.

just do:


import bge

#bge.render.showMouse(True) # This shouldnt be running all the time, use the Show Mouse setting for now

owner = bge.logic.getCurrentController().owner

SCALE = 10

mouse = bge.logic.mouse

rawX, rawY = mouse.position # (Center=(0.5,0.5))

## Center the raw mouse space and scale coordinates, needs tweaking ##
msX = (0.5-rawX)*SCALE
msY = (0.5-rawY)*SCALE

## Assuming the camera is pointing Top Down ##
owner.worldPosition = (msX, msY, 0)