Recently, I've started teaching myself Blender Game Engine with video tutorials. Mostly I utilize Logic Bricks, but I'm attempting to branch out into Python scripts.
I have successfully created a working custom mouse overlay using the following code:
import bge
cont = bge.logic.getCurrentController()
own = cont.owner
over = cont.sensors['over']
own.worldPosition = over.hitPosition
Unfortunately, when the plane I'm using reaches any edge of the game window it jumps back to the center of the viewport. It's very distracting and not the effect I'm going for at all.
What is the proper logic to prevent it from defaulting back to the center of the game window?