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. 

Get Num Materials doesn't work on Begin Play

Not sure if this a bug or just a limitation of how the engine handles the initialization. I made it with a spawned BP in 4.6.1. Interestingly it works with a delay that is zero seconds long. I guess that is then 1 tick when it is set to 0.

Product Version: Not Selected
Tags:
more ▼

asked Dec 30 '14 at 06:42 PM in Bug Reports

avatar image

Davision
945 104 147 201

avatar image Ben Halliday STAFF Dec 30 '14 at 07:34 PM

Hi Davison,

I wasn't able to reproduce the behavior you described. If I spawn an actor on begin play and then print the return from Get Num Materials, it gives me the correct value. Can you give me some images of your setup that was not working? Thanks!

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

1 answer: sort voted first

I'm pretty sure I know now what it was. There is a "set mesh" after the "spawn actor" and that mesh comes with a different material count. So I guess what was happening is that the set mesh and begin play was happening at the same time or set mesh just takes a little time.

more ▼

answered Dec 30 '14 at 09:19 PM

avatar image

Davision
945 104 147 201

avatar image Ben Halliday STAFF Dec 30 '14 at 09:40 PM

Yep, that makes sense. Giving it that extra tick to finish setting the mesh is probably what resolved the issue for you. Let us know if you have any more trouble with it!

(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