蓝图对象放到场景中ChildComponent 总在零零点问题

记录问题:
蓝图对象的其Box组件会生成在关卡的零点。 手动移动有问题的蓝图,有时候会使Box组件位置回到蓝图上,但是Box的旋转扔是固定的,没有跟随窗户蓝图本身的旋转。

解决办法:

原来代码:

SKeletalMeshMeshCom = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("SkeletonMeshCom"));
SKeletalMeshMeshCom->SetupAttachment(RootComponent);
SKeletalMeshCom = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("SkeletonMeshCom"));
    RootComponent = SKeletalMeshCom;

肯定与SetUpAttachment有关。

参考:

https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/69857-child-actor-components-spawning-in-odd-locations?view=stream

猜你喜欢

转载自blog.csdn.net/cartzhang/article/details/79502212