Hi so i’ve been setting up a asset manager and in the process of testing it i’ve been getting this error message
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000060
UE4Editor_UnrealCOC_7705!UAppearance_Class::ADescriptCon() [E:\UE4 games\UnrealCOC\Source\UnrealCOC\Appearance_Class.cpp:2873]
UE4Editor_UnrealCOC_7705!UAppearance_Class::PlayerAppearanceCon() [E:\UE4 games\UnrealCOC\Source\UnrealCOC\Appearance_Class.cpp:1438]
UE4Editor_UnrealCOC_7705!UAppearance_Class::execPlayerAppearanceCon() [E:\UE4 games\UnrealCOC\Intermediate\Build\Win64\UE4Editor\Inc\UnrealCOC\Appearance_Class.gen.cpp:32]
when trying to access a element of a loaded data asset (To be specific i’m trying to access a data table from a array of data tables in the data asset) this occurs even when I use loadobject to load the data asset
i’ve messed around with it a bit to try and fix it does any one know how to fix this problem, and if you have any questions please ask
Natalo77
(Natalo77)
January 10, 2022, 9:20am
2
Could you post the code pertinent to the error messages you have shown please?
Whenever you get an access violation near 0 (nullptr) it’s invariably because you’re trying to dereference a data member using a null pointer.
That is:
MyDataAsset = nullptr;
float Foo = MyDataAsset->SomeData; // <-- SomeData is @ 0x000000something
So your data asset is nullptr/None, you just need a valid reference.
Hey thanks for reply so far i’ve narrowed down the problem to the asset manager not loading in the requested assets and for LoadObject won’t load them ether here’s some code note: this isn’t the same code but its trying to do the same thing and causing the same error
DefaultEngine.ini
[/Script/Engine.Engine]
AssetManagerClassName=/Script/UnrealCOC.UnrealAssetManager
DT_Ref.h
class UNREALCOC_API UDT_Ref_Class : public UActorComponent{
GENERATED_BODY()
public:
UUnrealAssetManager& UAM = UUnrealAssetManager::GetObj();
void DeleFunc(FPrimaryAssetId ID);
FStreamableDelegate Delegate = FStreamableDelegate::CreateUObject(this,
&UDT_Ref_Class::DeleFunc, TAssetID);
UPROPERTY()
class UDataTable* DT_Data;
FPrimaryAssetId TAssetID = FPrimaryAssetId(FName("Tester"), FName("Test_DT_Assets"));
void Loader();
}
DT_Ref.cpp
void UDT_Ref_Class::DeleFunc(FPrimaryAssetId ID){
UTest_Prime_DT_DataAsset* Loaded =
UAM.GetPrimaryAssetObject<UTest_Prime_DT_DataAsset>(ID);
if (Loaded != nullptr) {
if (GEngine) {
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Yellow, TEXT("Working"));
}
DT_Data = Loaded->DataTables_Array[0];
}
else {
if (GEngine) {
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Yellow, TEXT("Not working"));
}
}
void UDT_Ref_Class::Loader(){
TArray<FName>Bundle = {};
UAM.LoadPrimaryAsset(TAssetID, Bundle, Delegate);
}
Natalo77
(Natalo77)
January 11, 2022, 8:33am
5
Can you please post and indicate the lines of the source code referred to in the initial error messages please?
I’m running into this same issue. Did you happen to find a fix or work around? Thanks!
Actually I just solved my own issue. There was a corrupted Level Sequence. Deleting that let me cook no problem.
Horizonik
(Horizonik)
January 17, 2023, 8:06pm
8
Also running into the same issue, it seems to have something to do with trying to spawn actors inside a constructor as opposed to on beginplay or at runtime
GigiK-K-K
(GigiK-K-K)
January 24, 2023, 7:57pm
9
Can you even do that, isn’t the world function used in begin play.
Horizonik
(Horizonik)
February 8, 2023, 2:37pm
10
You can pre-load the asset files in the constructor and then spawn them in BeginPlay