Ceox
(Ceox)
February 9, 2008, 1:31am
1
Hey,
I tried this script today, which I found on some page:
controller = GameLogic.getCurrentController()
owner = controller.getOwner()
owner.setCollisionMargin(0.01)
That script is supposed to change the collision margin in game physics, but it didn’t work. There was an error message in the console:
NameError: ‘GameLogic’ is not defined
How to fix it?
Regards, Ceox
Michael_W
(Michael W)
February 9, 2008, 3:16am
2
You need to have the python GameLogic module loaded…
try adding a line at the top
import GameLogic
at the top of the script…
Ceox
(Ceox)
February 9, 2008, 10:37pm
3
Thanks, but there’s still an error: ImportError: No module named GameLogic
Michael_W
(Michael W)
February 10, 2008, 12:21am
4
How are you running the script?
It won’t run from the text editor, GameLogic is only accessed from the game
It should be attached to a “controller” logic brick and will activate when you run the game
(with a sensor feeding in of course)
Ceox
(Ceox)
February 10, 2008, 1:52am
5
How does that happen?
and yes I used the text-editor…