Skip to content

Commit

Permalink
Merge pull request #13334 from CedricGuillemet/fixPluginv2compat
Browse files Browse the repository at this point in the history
fix missing plugin when enabling physics
  • Loading branch information
CedricGuillemet authored Dec 8, 2022
2 parents 3d4c7ec + 297244c commit eafdd73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/dev/core/src/Physics/physicsEngineComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Scene.prototype.enablePhysics = function (gravity: Nullable<Vector3> = null, plu
}

try {
if (plugin?.getPluginVersion() === 1) {
if (!plugin || plugin?.getPluginVersion() === 1) {
this._physicsEngine = new PhysicsEngineV1(gravity, plugin as IPhysicsEnginePluginV1);
} else if (plugin?.getPluginVersion() === 2) {
this._physicsEngine = new PhysicsEngineV2(gravity, plugin as IPhysicsEnginePluginV2);
Expand Down

0 comments on commit eafdd73

Please sign in to comment.