Hello. I have posted below a script, that I have used before, that sets the scene’s gravity. I have version 2.63 by the way. For some reason, it doesn’t work. I have a property sensor, that, when it equals 1, activates the python controller… or at least it’s supposed to. Is there something wrong with the script, or am I just being stupid ?
i dunno but i’m guessing the error is ‘-grav’ i don’t think you can make it minus just by putting in ‘-’ before calling the variable.
maybe test
grav = -9.8
GameLogic.setGravity([0.0, 0.0, grav])
and see if that gives errors. i have a working grav script somewhere… i’ll take a look at it when i get a chance.
It still didn’t work. I’m not sure what the problem is. Do you think it could be 'import GameLogic" ? Because I think someone told me before that in version 2.63, that isn’t right. I don’t know though.
Like esoneson said, check the console for errors. That way you can diagnose problems easily and really get into scripting, rather than letting every error hold you up while you wait for someone to help you.
I believe the error’s that the setGravity() function doesn’t have a captial S at the beginning, but for 2.6, you should use the 2.6 syntax / notation, which is to use the bge module as opposed to the GameLogic module. GameLogic in 2.4x = bge.logic in 2.5x+.