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"

Expose on spawn doesn't work for custom Components

BP_Slow seen on the screenshot is an ActorComponent. It has a variable called SlowingDownStrength. Everything works fine, when I set variable on Add [ComponentName] node's Details panel. But if I try to set this value from exposed node (here - using Literal Float), it seems to be ignored and value from Details takes effect instead. Is this a bug or am I doing something wrong? Is there any workaround to this problem?

alt text

Product Version: UE 4.14
Tags:
screenshot.png (65.4 kB)
more ▼

asked Dec 14 '16 at 12:10 PM in Blueprint Scripting

avatar image

b617
28 2 9

avatar image PatGlynn Apr 17 '17 at 06:51 AM

Any updates on this? Running into a similar issue, seems to ignore pins completely.

After looking around, I wonder if the expose on spawn is only meant to be used on actors and not components since there is no construction script?

avatar image F3NR1S Jul 04 '17 at 05:45 PM

I ran into the same issue here. I have two variables exposed on spawn. One works, the other doesn't. I suspect some internal issue. I will fiddle with it and see if I can get it to work for both variables.

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

1 answer: sort voted first

I found the answer in this post: https://answers.unrealengine.com/questions/339643/values-of-expose-on-spawn-variables-of-component-a.html

To summarize: expose on spawn is not equivalent concept or part of the constructor of the actor/component/blueprint as one could think. In other words the events/begin play node may execute before the exposed on spawn variables are set. Workarounds include but not limited to:

  • Add a small delay after your begin play node which will allow the exposed on spawn variables to be set.

  • Use an initialize function after creation.

  • Delegate the initialization responsibility to another actor (if architecture allows).

I feel this should resolve the issue here. However I do agree with the reports it is counter intuitive.

Some interesting follow-up questions could be:

  • Why is this constraints? What benefits does it allow the engine? Concurrency?

  • Could this behavior be changed to fall under the constructor idiom in blueprints?

  • Is this improvement prioritized? Is there a tracker for it?

more ▼

answered Jul 04 '17 at 06:01 PM

avatar image

F3NR1S
93 5 7 10

(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