UKismetArrayLibrary::Array_Find crashes the code

Hi! I am trying to just find an int32 in a Tarray and its crashing the code.

UFUNCTION(BlueprintCallable)
	int32 ittemsAmmount()
	{
		return UKismetArrayLibrary::Array_Find(numbers,45);
	}

tried other UkismetArrayLibrary functions like Array_Lenght with same results.

The array is not empty (perhaps if it where should return -1 instead crashing, but the main problem is that even it is a valir array the program crashes.

the error:


LoginId:af1dc0cc4a38f161ce1ec1866b8766c4
EpicAccountId:85ca757936b941ae88ca0ea516e06388

Assertion failed: 0 [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Engine/Private/KismetArrayLibrary.cpp] [Line: 580]

UE4Editor_Core
UE4Editor_Core
UE4Editor_Engine
UE4Editor_MyProject8!AmiDamemodeCPP::execittemsAmmount() [F:\00 UE\MyProject8\Intermediate\Build\Win64\UE4Editor\Inc\MyProject8\miDamemodeCPP.gen.cpp:25]
UE4Editor_CoreUObject

any help?

[File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Engine/Private/KismetArrayLibrary.cpp

this calls my attention…why D??? I have a D drive but not using it and D:/Build doesn’t exists.

That’s not going to work. Yu shouldn’t really ever need to use any functions from the Kismet libraries, these functions in particular use CustomThunk bodies which are special Blueprint code.

Just use the built-in functions within the array (i.e, MyArray.Find(value). It will return a pointer to a value IF it exists.

2 Likes

Thanks!