diff --git a/SDK/src/NDK/Systems/PhysicsSystem3D.cpp b/SDK/src/NDK/Systems/PhysicsSystem3D.cpp index 5d5a1883d..d30a2f12a 100644 --- a/SDK/src/NDK/Systems/PhysicsSystem3D.cpp +++ b/SDK/src/NDK/Systems/PhysicsSystem3D.cpp @@ -60,6 +60,18 @@ namespace Ndk { m_dynamicObjects.Remove(entity); m_staticObjects.Insert(entity); + + // If entities just got added to the system, teleport them to their NodeComponent position/rotation + // This will prevent the physics engine to mess with the scene while correcting position/rotation + if (justAdded) + { + auto& collision = entity->GetComponent(); + auto& node = entity->GetComponent(); + + Nz::RigidBody3D* physObj = collision.GetStaticBody(); + physObj->SetPosition(node.GetPosition()); + physObj->SetRotation(node.GetRotation()); + } } if (!m_world)