Get Current State

Hello again, this is a fairly straightforward question (at least I hope it is). I was just wondering if there was a Python…command (is that what they’re called?) that would get the current state the controller was in. Is there any way to do this? Thanks.

Also, I’m using 2.49, if that makes a difference.


# 2.4 
import GameLogic as G
cont = G.getCurrentController()
state_  = cont.owner.state
print  "CurrentState", state_

# 2.5
import bge
G =  bge.logic
cont = G.getCurrentController()
state_  = cont.owner.state
print ("CurrentState", state_)

but you can also click on the + button left of the controller, thenn click on the “i” button , to make the state visible in the debug properties.
:cool: