I’m at the end of this lecture and i get a failure when trying to package, it’s something with the ReplicationComponent; I guess that NeedInitialization but i tried adding the Initialize method to the component but didn’t work
Error PackagingResults === Handled ensure: ===
Error PackagingResults Ensure condition failed: !NeedsInitialization() [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Components\ActorComponent.cpp] [Line: 2045]
Error PackagingResults SetIsReplicatedByDefault is preferred during Component Construction.
Error PackagingResults Stack:
Error PackagingResults [Callstack] 0x00007ffce2264b5d UnrealEditor-Engine.dll!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ffcb74a8a6a UnrealEditor-MTD.dll!UCarReplicationComponent::UCarReplicationComponent() [E:\UnrealProjects\MTD\Source\MTD\Components\CarReplicationComponent.cpp:14]
Error PackagingResults [Callstack] 0x00007ffce5dfc44d UnrealEditor-CoreUObject.dll!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ffce5c50ebe UnrealEditor-CoreUObject.dll!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ffce608ec14 UnrealEditor-CoreUObject.dll!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ffce5f62f2f UnrealEditor-CoreUObject.dll!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ffcb74a2f9c UnrealEditor-MTD.dll!ACarBase::ACarBase() [E:\UnrealProjects\MTD\Source\MTD\Actors\Cars\CarBase.cpp:18]
Error PackagingResults [Callstack] 0x00007ffce5dfc44d UnrealEditor-CoreUObject.dll!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ffce60d04dd UnrealEditor-CoreUObject.dll!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ffce60b030b UnrealEditor-CoreUObject.dll!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ffce5f682a5 UnrealEditor-CoreUObject.dll!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ffce688a5c2 UnrealEditor-Core.dll!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ffce68ae937 UnrealEditor-Core.dll!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ffd216faaf6 UnrealEditor-Projects.dll!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ffd216fae31 UnrealEditor-Projects.dll!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ff6310e53cb UnrealEditor-Cmd.exe!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ff6310e866e UnrealEditor-Cmd.exe!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ff6310e0bbd UnrealEditor-Cmd.exe!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ff6310e0e8a UnrealEditor-Cmd.exe!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ff6310e3c4d UnrealEditor-Cmd.exe!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ff6310f5564 UnrealEditor-Cmd.exe!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ff6310f788a UnrealEditor-Cmd.exe!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ffd93507034 KERNEL32.DLL!UnknownFunction []
Error PackagingResults [Callstack] 0x00007ffd949a2651 ntdll.dll!UnknownFunction []
Error PackagingResults end: stack for UAT```
CarReplicationComponent.cpp line from 7 trough 16:
// Sets default values for this component's properties
UCarReplicationComponent::UCarReplicationComponent()
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
// off to improve performance if you don't need them.
PrimaryComponentTick.bCanEverTick = true;
// ...
}
CarBase.cpp line 8-19:
ACarBase::ACarBase()
{
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
bReplicates = true;
ReplicationComponent = CreateDefaultSubobject<UCarReplicationComponent>("Replication Component",false);
MovementComponent = CreateDefaultSubobject<UCarMovementComponent>("Movement Component",false);
ReplicationComponent->SetIsReplicated(true);
}