I’m trying to change an objects visibility through python, but am having some problems.
cont = GameLogic.getCurrentController()
own = cont.owner
own['visible'] = 0
The code runs, and no errors occur, so I have no idea what’s wrong. :spin:
I’m trying to change an objects visibility through python, but am having some problems.
cont = GameLogic.getCurrentController()
own = cont.owner
own['visible'] = 0
The code runs, and no errors occur, so I have no idea what’s wrong. :spin:
own[‘visible’] would be a game property on the object (like one defined in the logic editor). You want own.visible, which is the visible attribute of KX_GameObject.
I tried your suggestion and got no result. I did however get the object to disappear by using the setVisible() method.
You may be using an older version of Blender. setVisible() was replaced with visible