Blender 2.5 Game Property

Hello, I have added a game property in a cube
prop Boolean

When I press the space key I want to change the game property. So I add a keyboard sensor and connect it to a python script.

Now here’s the code:

import bge

controller = bge.logic.getCurrentController()

print(dir(controller.owner))

How can I access the property? Any ideas? :confused:

Sorry, brain not engaged at the moment, but this script changes the value of a property called “Text” to a value retrieved from a globalDict variable:

# Setting things up
# get the  GameLogic module
import GameLogic


# get controller script is attached to
controller = GameLogic.getCurrentController()

# get new position vector string
position_out = GameLogic.globalDict["position_vec"]

# send it to the HUD-Position property "Text"
controller.owner["Text"] = position_out

# End script

# You can use bge.logic or GameLogic in Blender 2.5
import bge

ob = bge.logic.getCurrentController().owner

print(ob['my_prop'])

Thanks a lot! This is the trick.

I made an example here to use it as a reference from now on
http://blenderartists.org/forum/showthread.php?t=198887