I set off to create a rigged door, thinking a single mesh object with moving parts should be easier to manage than having each part as a separate object - especially once there are a large number of doors in a level and some doors have many animated parts.
If the physics calculations turn out to be too slow I will reconsider this approach, but I want to test it out. Besides, knowing how to update the physics mesh will be useful for many other situations too.
Here is my test scene with a player object (Character collision type) that falls onto a trap door mesh object. Collision with the mesh object triggers a Message to its parent armature and an Action Actuator plays the rigged animation of the door opening. This part is working fine.
From what I've read, when a mesh deforms, if collisions are required it must be updated using
Official documentation on it is here, but to be honest I don't understand all of what's written there. For example, it seems that arguments are optional, but are they optional in my case? Not sure.
I tried writing a simple script for this, but I believe my syntax is wrong because the player object does not fall through the trap door, and as you can see from the physics debugging visualization, the physics mesh is not updating.
import bge cont = bge.logic.getCurrentController() own = cont.owner char_coll = cont.sensors["CharColl"] if char_coll.positive: print("Character collision detected") own.reinstancePhysicsMesh()