首页 > 代码库 > 让炮台口逐渐转向玩家(四元数)

让炮台口逐渐转向玩家(四元数)

1  Quaternion targetRotation = Quaternion.LookRotation(destPos - transform.position);
2  transform.rotation = Quaternion.Slerp(transform.rotation,targetRotation,Time.deltaTime*curRotSpeed);

 

让炮台口逐渐转向玩家(四元数)