# Order of BeginPlay Events in different Blueprints

**URL:** <https://forums.unrealengine.com/t/order-of-beginplay-events-in-different-blueprints/435723>\
**Category:** Blueprint\
**Tags:** beginplay, order, unreal-engine, level-blueprint, Blueprint, question\
**Created:** [October 16, 2018, 8:51am UTC](https://forums.unrealengine.com/t/order-of-beginplay-events-in-different-blueprints/435723 "2018-10-16T08:51:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_c3e69a5a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c3e69a5a](https://forums.unrealengine.com/u/anonymous_user_c3e69a5a)\
**Post date:** [October 16, 2018, 8:51am UTC](https://forums.unrealengine.com/t/order-of-beginplay-events-in-different-blueprints/435723/1 "2018-10-16T08:51:50Z")

</div>

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):

 ![256718-1-rendererblueprint.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/9/f/19f6af4427d1c029b20ebda6ce10b27165d13c4c.jpeg)

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

 ![256719-2-levelblueprint.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/8/1/08130e9499704995c8e35b3738680b68f01902ad.jpeg)

Finally, in the second Blueprint, I use the variable to call a specific method of it:

 ![256720-3-generatorblueprint.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/0/b/70b431265543a18086fded3768ec1debb9d823aa.jpeg)

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?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 16, 2018, 10:41am UTC](https://forums.unrealengine.com/t/order-of-beginplay-events-in-different-blueprints/435723/2 "2018-10-16T10:41:39Z")

</div>

Regarding he execution order, check my answer [here](https://answers.unrealengine.com/questions/830519/any-reason-for-a-difference-in-execution-order-for.html), 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.

---

<div class="post-metadata">

**Author:** ![HarryHighDef](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HarryHighDef](https://forums.unrealengine.com/u/HarryHighDef)\
**Post date:** [October 16, 2018, 10:45am UTC](https://forums.unrealengine.com/t/order-of-beginplay-events-in-different-blueprints/435723/3 "2018-10-16T10:45:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c3e69a5a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c3e69a5a](https://forums.unrealengine.com/u/anonymous_user_c3e69a5a)\
**Post date:** [October 16, 2018, 11:05am UTC](https://forums.unrealengine.com/t/order-of-beginplay-events-in-different-blueprints/435723/4 "2018-10-16T11:05:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c3e69a5a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c3e69a5a](https://forums.unrealengine.com/u/anonymous_user_c3e69a5a)\
**Post date:** [October 16, 2018, 11:15am UTC](https://forums.unrealengine.com/t/order-of-beginplay-events-in-different-blueprints/435723/5 "2018-10-16T11:15:12Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c3e69a5a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c3e69a5a](https://forums.unrealengine.com/u/anonymous_user_c3e69a5a)\
**Post date:** [October 16, 2018, 11:26am UTC](https://forums.unrealengine.com/t/order-of-beginplay-events-in-different-blueprints/435723/6 "2018-10-16T11:26:49Z")

</div>

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

 ![256731-4-customevents.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/7/0/c70d0a2edabd5e6c34c54a181704a7c3664cd221.jpeg)

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

 ![256732-5-startinginlevelblueprint.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/5/4/254f0c6cc61ffd4835091215428a663e35d20e74.jpeg)

Thank you for your advice!
