diff --git a/src/ign_actor_plugin/src/ActorSystem.cpp b/src/ign_actor_plugin/src/ActorSystem.cpp index 8a040a8..048796a 100644 --- a/src/ign_actor_plugin/src/ActorSystem.cpp +++ b/src/ign_actor_plugin/src/ActorSystem.cpp @@ -172,6 +172,15 @@ void ActorSystem::PreUpdate(const UpdateInfo &_info, EntityComponentManager &_ec movementDetails.rotateToTargetDuration = 0.0; movementDetails.moveDuration = 0.0; } + + if( + movementDetails.target.Rot().W() == 0 && + movementDetails.target.Rot().X() == 0 && + movementDetails.target.Rot().Y() == 0 && + movementDetails.target.Rot().Z() == 0 + ){ + movementDetails.target.Rot() = movementDetails.targetDiff.Rot(); + } movementDetails.rotateToEndDuration = Angle(movementDetails.targetDiff.Rot(),movementDetails.target.Rot()) / turnSpeed; }