Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Getting data from struct crahses IOS game


I have made a struct in c++, this struct contains information about worlds in my game, because the player is able to switch worlds instantly and I am using 1 persistent level with sub levels. Then in my game instance class, I have the following TArray:

 * Array holding the data of all the worlds, data is set in the game instance BP
 UPROPERTY(BlueprintReadOnly, EditAnywhere, Category = "Worlds")
     TArray<FWorldData> Worlds;

alt text

The contents of this TArray are being coppied to an UnlockManager class which checks if the worlds are unlocked etc.


 void UUnlockManager::PopulateWorldsArray(TArray<FWorldData> _worlds)
     Worlds = _worlds;

Now, one of the datatypes this struct is holding is the following:

 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Level Data")
         UAnimBlueprintGeneratedClass* DefaultCharacterAnimClass;

Now, when I try to get the current game world (FWorldData struct) in my game mode, read it out in Blueprint and break the struct to get the DefaultCharacterAnimClass pointer variable.. My game crashes.

 FWorldData AEndlesRunnerGameMode::GetCurrentWorldData()
     return currentWorldData;

alt text

All the other contents of the struct read out fine, but getting that one crashes my game, and also, only on IOS. Not on windows, not on Mac, not while PIE.

Somehow when my game crashes, it won't generate crash log files anymore on the IOS device, so I am kind of in the dark here..

I need that DefaultCharacterAnimClass because the mesh of the player is different in each world, and so I need to change the AnimationInstanceClass of that mesh to the correct animation blueprint so that the character is animated.

I hope this all makes sense to someone and that maybe someone know's what's going wrong here.

Product Version: UE 4.19
bp.png (106.4 kB)
more ▼

asked Aug 08 '18 at 12:29 PM in C++ Programming

avatar image

27 5 5 11

avatar image iProspartan117 Aug 08 '18 at 12:56 PM

Also, when I try to pass the whole struct, It crashes.. this did not happen before :(

avatar image dZh0 Aug 08 '18 at 01:12 PM

It will be very hard to debug this without a crash log...

Do you have access to other iOS devices with different iOS versions? Could it be that you don't have space and for the same reason you can't save a crash log? (highly implausible) Can you debug your game with a profiler on the device? (I really don't know if it is possible) Could it be that you ran out of memory? Could it be that the graphic driver crashed? (it always outputs a log though)

Also there is a quirk in iOS that it automatically kills processes that do not respond for a few seconds. (lower threshold than any other OS and with no warning pop-up)

avatar image iProspartan117 Aug 08 '18 at 01:20 PM

I just compiled my project from xcode, and then launched again via the ue4 editor, and voila.. it works. I don't know how, I don't know why.. nothing changed except that I first compiled via xcode, which installed the game on my device, but that one crashes automatically after the splash screen because it only builds the source code, so all the other project files are missing..

Then I re opend the editor, launched from there and it works..

avatar image iProspartan117 Aug 08 '18 at 01:21 PM

I am going to test a bit more, to see if this really was the fix, when it is, I will mark this question as resolved :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

After some trial and error I figured out that when I build the game in Xcode first, and after that, launch it from the editor, everything works as intended.

more ▼

answered Aug 08 '18 at 01:59 PM

avatar image

27 5 5 11

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question