0
$\begingroup$

This script below is very helpful:

import bge

def update(cont):
    own = cont.owner
    own.reinstancePhysicsMesh()

if __name__ == '__main__':
    update(bge.logic.getCurrentController()) 

What goes in the spaces?
By spaces, I mean what script or property do I put in the
____ _____ blanks of the script? I'm assuming they are for object names.

I'm trying add physics and collisions to my project.

$\endgroup$
  • 1
    $\begingroup$ What do you mean? Could it be you mean "apply" rather than "reply". What do you mean with spaces? I suggest to rephrase our question. $\endgroup$ – Monster Sep 1 '16 at 4:23
1
$\begingroup$

The __name__ and __main__ are as they should be. You do not need to put anything in the underlined places.

__name__ is a variable that either contains the name of the script or the string "__main__" if you run the code in script mode. Again, you don't need to touch them.


I doubt this script will help your issue though. You probably need to look at how to set up a proper character system in BGE. Armatures don't do physics.

$\endgroup$
  • $\begingroup$ thanks loads sdfgeoff, by a character system do you mean action keys and and more than just logic bricks? or properties or a fully custom command script? im really not sure where to go from my demo $\endgroup$ – seigmyer of catarina Dec 5 '16 at 5:38
  • $\begingroup$ Generally you should't be reinstancing the physics mesh every frame. It's quite performance hungry. Instead, parent collision bounds to each bone. (Probably). Not knowing what your setup is, I can't offer much advice. $\endgroup$ – sdfgeoff Dec 5 '16 at 19:42
0
$\begingroup$

I still do no know what you mean with

What goes in the spaces?

Here is the short version of the code you mention above:

import bge 
bge.logic.getCurrentController().owner.reinstancePhysicsMesh()

throw it into a text file and setup a Python controller in script mode that runs that file.

$\endgroup$
  • $\begingroup$ No sorry about that. We can't know everything. That's why we have such nice services as stack exchange. As long as we can get what you are aiming for we might be able to help. $\endgroup$ – Monster Dec 6 '16 at 6:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.