Only set kinematic target if rigid body has kinematic flag.

This commit is contained in:
Chandler Cox
2026-03-02 19:20:15 -06:00
parent c51a023e61
commit f7e2f3a4d5

View File

@@ -2450,7 +2450,7 @@ void PhysicsBackend::SetRigidActorPose(void* actor, const Vector3& position, con
if (kinematic)
{
auto actorPhysX = (PxRigidDynamic*)actor;
if (actorPhysX->getActorFlags() & PxActorFlag::eDISABLE_SIMULATION)
if (actorPhysX->getActorFlags() & PxActorFlag::eDISABLE_SIMULATION || !(actorPhysX->getRigidBodyFlags() & PxRigidBodyFlag::eKINEMATIC))
{
// Ensures the disabled kinematic actor ends up in the correct pose after enabling simulation
actorPhysX->setGlobalPose(trans, wakeUp);