Download

I've been been getting this Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000060 error when trying to access a element of a data asset

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

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);
}

Can you please post and indicate the lines of the source code referred to in the initial error messages please?