diff --git a/cocos/3d/skinned-mesh-renderer/skinned-mesh-renderer.ts b/cocos/3d/skinned-mesh-renderer/skinned-mesh-renderer.ts index 3ee9d4b6bf..e77631a89c 100644 --- a/cocos/3d/skinned-mesh-renderer/skinned-mesh-renderer.ts +++ b/cocos/3d/skinned-mesh-renderer/skinned-mesh-renderer.ts @@ -26,6 +26,7 @@ import { ccclass, executeInEditMode, executionOrder, help, menu, tooltip, type, } from 'cc.decorator'; +import { EDITOR } from 'internal:constants'; import type { AnimationClip } from '../../core/animation/animation-clip'; import { Material } from '../../core/assets'; import { Skeleton } from '../assets/skeleton'; @@ -104,6 +105,9 @@ export class SkinnedMeshRenderer extends MeshRenderer { public onLoad () { super.onLoad(); + if (EDITOR) { + this._objFlags |= legacyCC.Object.Flags.IsPositionLocked | legacyCC.Object.Flags.IsRotationLocked | legacyCC.Object.Flags.IsScaleLocked; + } this._tryBindAnimation(); }