修复轨道摄影机OrbitCamera的目标对象释放时,相机跟随逻辑报错问题

This commit is contained in:
dgflash
2025-03-26 12:26:48 +08:00
parent 8e530041e2
commit 0f5d60b03c

View File

@@ -220,7 +220,7 @@ export class OrbitCamera extends Component {
targetRotation.y += this.autoRotateSpeed * dt;
}
if (this.target) {
if (this.target && this.target.isValid) {
// 重置摄像机中心点
this._targetCenter.set(this.target.worldPosition);