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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

What is the correct way to dynamically load assets

I ran into the problem that assets loaded dynamically like:

 UStaticMesh* shapeAsset = Cast<UStaticMesh>(StaticLoadObject(UStaticMesh::StaticClass(), NULL, *assetName));

do not show up in android, but do show up in the editor when I run the game.

What I read from forum posts is that this has to do with the cooking of the game, where it only cooks assets that are needed when classes are initialized (so loaded in the constructor with the FObjectFinder for example)

But I'm making a game where a lot of different shapes can spawn (each shape is an asset), so what I do is spawn an actor from the GameMode and then call a function to load one of the shapes. Not all shapes need to be loaded all the time... normally only 5 shapes are active at a time.

So what is the correct way to handle this situation? How can I make sure these assets are coocked in the game?

thanks for any information!

Product Version: UE 4.8
Tags:
more ▼

asked Aug 14 '15 at 10:16 PM in C++ Programming

avatar image

BramV
391 36 36 79

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

1 answer: sort voted first

If you need to forcibly cook some assets, you can add the path(s) containing those assets to the "Additional Asset Directories to Cook" array in your project settings. "Project Settings" -> "Packaging" -> (Advanced Section) -> "Additional Asset Directories to Cook".

more ▼

answered Aug 15 '15 at 12:22 AM

avatar image

Jamie Dale STAFF
7.5k 176 66 304

(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