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. 

Order of BeginPlay Events in different Blueprints

Hi, I wanted to ask what the order of Execution of BeginPlay Events is. My Goal: I have two Blueprints. The second one needs a reference to the component of the first one, and it needs it at the beginning of the game.

So my first blueprint creates a public variable holding the reference, during construction script (so it should be there right after I place the blueprint in the editor): alt text

In my Level Blueprint, I set another public variable of the second blueprint to that reference (at BeginPlay): alt text

Finally, in the second Blueprint, I use the variable to call a specific method of it: The RenderPointCloud Method is called last

In the Render Pointcloud Method I check whether the "PointcloudRenderer" is set - and it isn´t during first execution.

How can I build this up, so that Render Pointcloud is called after all variables had surely been set?

Product Version: UE 4.18
Tags:
more ▼

asked Oct 16 '18 at 08:51 AM in Blueprint Scripting

avatar image

DaKenpachi
79 4 6 10

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

2 answers: sort voted first

Regarding he execution order, check my answer here, especially the link. The order is different for editor and stand-alone.

One way to handle the order of execution, is to use a single Begin Play (in GameMode, for example) and use it to spawn dynamic objects and have their Custom Events / Construct / Dispatcher scripts executed from this single entry point.

more ▼

answered Oct 16 '18 at 10:41 AM

avatar image

Everynone
14.7k 76 25 61

avatar image DaKenpachi Oct 16 '18 at 11:15 AM

Thanks, this is a really good post! =D Now I can see that the problem was that in editor mode the level BeginPlay is executed after the Actor BeginPlay (in this case my Blueprint).

avatar image DaKenpachi Oct 16 '18 at 11:26 AM

Yep, using Custom Events did the job for me. I created two of them in my second blueprint: alt text

And called them in my Level blueprint in the right order: alt text

Thank you for your advice!

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

You can have your second blueprint contain a reference to the first blueprint that you can set in editor. That way it can get the component itself on BeginPlay before it needs it.

more ▼

answered Oct 16 '18 at 10:45 AM

avatar image

HarryHighDef
1.4k 1 14 17

avatar image DaKenpachi Oct 16 '18 at 11:05 AM

Hm yeah that could be an idea. Problem is, though, that I want just a reference to a (c++ written) component, which is part of the blueprint. So later I can maybe use different blueprints having that component, and not be bound to the blueprint itself

(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