Tracking and plotting characters movement

Hello,

Today I just discovered that blender has a game engine and now I am trying to figure out how it works. I would like to use blender to develop mazes and have people navigate through them. So far I have been able to create a maze and a character with a 1st person view. Now what I am trying to do is track the location of the character and print out a time table which contains the x,y,z locations. Is there a function in blender which can do this?

My future plan is once I can print out xyz, I will change the speed which the character can travel and measure how fast the character was moving and where they were positioned during the navigation through the maze.

Hi Hojo, here is a link to the bge api. The KX_GameObject has properties to get position / speed and the like: https://www.blender.org/api/blender_python_api_2_77_0/bge.types.KX_GameObject.html#bge.types.KX_GameObject.worldPosition

After that add change the python code something like:


#import bge files
import bge
#get current controller
cont = bge.logic.getCurrentController()
#get owner
own = cont.owner
#print owner's world positions
print(own.worldPosition)
print(own.worldPosition.x)
print(own.worldPosition.y)
print(own.worldPosition.z)