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
  • 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, 2016 at 4:23

2 Answers 2

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$
2
  • $\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$ Dec 5, 2016 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, 2016 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$
1
  • $\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, 2016 at 6:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .