x

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"

Can't load AnimMontage in Android device using C++

When use LoadObject to load Montage object, LoadObject always return NULL in Android device, but it works fine in Windows Editor.

 UAnimMontage* AnimMtgAkt01 = LoadObject<UAnimMontage>(NULL, TEXT("AnimMontage'/Game/Mannequin/Rex/Rex_AnimMtg_Attack01.Rex_AnimMtg_Attack01'"));

Product Version: UE 4.16
Tags:
more ▼

asked Jun 01 '17 at 10:24 AM in Bug Reports

avatar image

笑傲江湖-DA
216 14 24 32

avatar image 笑傲江湖-DA Jun 02 '17 at 10:39 AM

By the way, LoadObject always return NULL when running on Client(NetMode is NM_Client) in Windows device. UE4 version is 4.16

avatar image Matthew J Jun 02 '17 at 04:20 PM

Hello,

This seems like something that is caused by the asset not being cooked into the project. This could be due to the references being made to it. If you are calling the line of code you posted on construction on a class that is being referenced by a map that you are cooking, it should be included automatically. I had this work correctly on both Windows and Android placing a Blueprint of the following class in the map: Pastebin.

However, if it is being called somewhere like BeginPlay, the editor doesn't recognize that this asset is ever being referenced in the maps that are being cooked so it doesn't cook it into the package. If this is the case, you can fix this by adding the asset's folder to the "Additional Asset Directories to Cook" in Project Settings > Packaging under the expanded settings. This will force the asset to be cooked even if it isn't being referenced.

avatar image 笑傲江湖-DA Jun 03 '17 at 03:59 AM

Thx for your reply, but it doesn't work, even I added "Additional Asset Directories to Cook" and checked "cook everything in the project content directory", LoadObject always return NULL in BeginPlay function. If LoadObject in Construct of MyUserWidget, Server would crash when startup I uploaded log file of Server when startup link text

 UPVPWidget::UPVPWidget(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
 {
     AnimMtgAkt01 = LoadObject<UAnimMontage>(NULL, TEXT("AnimMontage'/Game/Mannequin/Rex/Rex_AnimMtg_Attack01.Rex_AnimMtg_Attack01'"));
     AnimMtgAkt02 = LoadObject<UAnimMontage>(NULL, TEXT("AnimMontage'/Game/Mannequin/Rex/Rex_AnimMtg_Attack02.Rex_AnimMtg_Attack02'"));
     AnimMtgSkill01 = LoadObject<UAnimMontage>(NULL, TEXT("AnimMontage'/Game/Mannequin/TestModel/AnimMtgAttack_02.AnimMtgAttack_02'"));
 }
cubego.log (12.4 kB)
avatar image 笑傲江湖-DA Jun 03 '17 at 08:53 AM

By the way, it works fine with the same source when running in version 4.15. but it failed with 4.16 .

avatar image Matthew J Jun 21 '17 at 04:27 PM

I apologize for the delay on this but I'm not able to reproduce the issue. Could you provide a sample project that reproduces this problem?

avatar image 笑傲江湖-DA Jun 22 '17 at 04:24 AM

That's all right. I have uploaded project that can reproduce issue on box:https://app.box.com/s/8hdk7stxwg1fbcwkbovqfo4sbkiqlrtt

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

1 answer: sort voted first

4.16.2 has fixed this issue.

more ▼

answered Jun 30 '17 at 03:24 AM

avatar image

笑傲江湖-DA
216 14 24 32

(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