LoginId:c94d24654bb053080c17c2ad5040f05a
EpicAccountId:fccedefcd3d646a6a9f2c9f009701903
Fatal error: [File:D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\Templates\Casts.cpp] [Line: 10] Cast of World /Game/UEDPIE_0_Sandbox.Sandbox to Gun failed
UnrealEditor_CoreUObject
UnrealEditor_SimpleShooter_patch_0!AShooterCharacter::BeginPlay() [D:\unreal\Unreal Projects\SimpleShooter\Source\SimpleShooter\ShooterCharacter.cpp:22]
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
kernel32
ntdll
Even if I built it, it didn’t update the game, so I ran the game after live coding.
But the picture-like screen keeps popping up, shutting down Unreal.
UPROPERTY(EditDefaultsOnly)
TSubclassOf<AGun> GunClass;
UPROPERTY()
AGun* Gun;
void AShooterCharacter::BeginPlay()
{
Super::BeginPlay();
UE_LOG(LogTemp, Error, TEXT("MoveRight AxisValue:"));
Gun = GetWorld()->SpawnActor<AGun>(GunClass);
GetMesh()->HideBoneByName(TEXT("weapon_r"), EPhysBodyOp::PBO_None);
Gun->AttachToComponent(GetMesh(), FAttachmentTransformRules::KeepRelativeTransform, TEXT("WeaponSocket"));
Gun->SetOwner(this);
}