Attempted to access index 0 from array of length 0 in Character BP

Attempted to access index 0 from array of length 0 in Character BP. There is no error/warning in my char BP nor in compile or output log. This is however what I’m getting in packaged game crash log causing crash for some reason.

LogScript: Warning: Script Msg: Attempted to access index 0 from array ‘CallFunc_GetAllActorsOfClass_OutActors_4’ of length 0 in ‘/Game/_MyStuff/Characters/Benyamin/BP_Benyamin.BP_Benyamin_C:ExecuteUbergraph_BP_Benyamin’!

It’s apparently trying to call a function but gets a wrong index but nowhere I’m seeing in editor the issue. it’s only being called “wrong” in “packaged game”. I double checked the packaging settings too but what does index 0 from array of length 0 mean?!

You’re doing a ‘get all actors of class’ and then taking index 0. But there are no actors of that class.

Timing changes a lot in packaged games, something’s not ready, when you assume it is.

2 Likes

Nice thank you! I fixed the issue. so I was getting the first actor of a class but there was no first actor or in other words index 0 was I assume empty on my part

2 Likes

How did you fix this issue? Looking forward to your reply。

Make sure something is in the array…