childMesh.getPhysicsImpostor is not a function

We have an app with a bit of physics in it, that has been working fine up until PhysicsPlugin refactor by CedricGuillemet · Pull Request #13279 · BabylonJS/Babylon.js · GitHub.

Specifically, it looks like the V1 of PhysicsEngineComponent does not get imported, unless explicitly done like so:

import "@babylonjs/core/Physics/physicsEngineComponent";
import "@babylonjs/core/Physics/v1/physicsEngineComponent";

Unless imported like this, when childMesh.getPhysicsImpostor wants to be called in Babylon.js/ammoJSPlugin.ts at master · BabylonJS/Babylon.js · GitHub it fails.

Is this breaking change expected? I was looking but couldn’t find any docs on the migration to the new physics thing, so given the back compatibility expectation stated in that PR, perhaps it is a bug?

It’s a bug. back compatibility should be preserved here.
I’ll do the fix.

1 Like

@jure can you please do a PG that shows the issue? I’ll use it to check that I properly fixed the issue.

1 Like

I believe I have found the cause.
Let me run a few tests, I hope to find a solution by tomorrow.