# How to branch two spawning patterns

**URL:** <https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323>\
**Category:** Programming & Scripting\
**Tags:** beginner, unreal-engine, question, Blueprint\
**Created:** [February 5, 2025, 4:56am UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323 "2025-02-05T04:56:29Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![ybenjamin0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ybenjamin0](https://forums.unrealengine.com/u/ybenjamin0)\
**Post date:** [February 5, 2025, 4:56am UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323/1 "2025-02-05T04:56:29Z")

</div>

I have a starting solution to where first type of enemy will spawn from the spawnpoints in a array within 5 seconds each. but im trying to figure out how when the 5 seconds ends, another type of enemy will spawn from the same spawnpoints for 5 seconds once, then it will repeat back to the first enemy (like a cycle). So far, i have this level blueprint nodes to start off, then i got stuck. Any help is appreciate.

 ![Screenshot 2025-02-04 233714](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/4/6/c46345cef10fa4d8c59e7a72d5e23469daaa6edc.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [February 5, 2025, 8:29am UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323/2 "2025-02-05T08:29:46Z")

</div>

Something like this

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/8/1/c814f3bd5e66563708a2bb850730f06dbac6ee7c.png)

![spawn2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/0/7/4077c3dab5ce3211764d8a114b67b1daf7bc94c2.gif)

---

<div class="post-metadata">

**Author:** ![ybenjamin0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ybenjamin0](https://forums.unrealengine.com/u/ybenjamin0)\
**Post date:** [February 5, 2025, 10:26pm UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323/3 "2025-02-05T22:26:45Z")

</div>

can you explain your version a little?

---

<div class="post-metadata">

**Author:** ![ybenjamin0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ybenjamin0](https://forums.unrealengine.com/u/ybenjamin0)\
**Post date:** [February 5, 2025, 10:29pm UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323/4 "2025-02-05T22:29:23Z")

</div>

but ill try your version soon today. ill let you know for an update

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [February 6, 2025, 8:23am UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323/5 "2025-02-06T08:23:21Z")

</div>

Best thing is to give it a go, tell me if you get stuck 🙂

---

<div class="post-metadata">

**Author:** ![ybenjamin0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ybenjamin0](https://forums.unrealengine.com/u/ybenjamin0)\
**Post date:** [February 8, 2025, 5:26pm UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323/6 "2025-02-08T17:26:23Z")

</div>

im confused about the select node. How did you get two class references in the enemy class variable? i can only do true and i cant get another reference to put in false?

 ![image_2025-02-08_122612982](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/6/d/26d2ac91afc100397c33ba915b7400408265bf23.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [February 8, 2025, 7:16pm UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323/8 "2025-02-08T19:16:50Z")

</div>

I think you might be having problems with what sort of variable to use. But you don’t need to know, if you do it all by dragging

![spawn](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/0/2/702989eb4738a1be4105c038ef48839627d1499b.gif)

![select](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/4/3/243a7b3750a82915ca79ba1d5840cb89a8242aff.gif)

---

<div class="post-metadata">

**Author:** ![ybenjamin0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ybenjamin0](https://forums.unrealengine.com/u/ybenjamin0)\
**Post date:** [February 8, 2025, 8:07pm UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323/9 "2025-02-08T20:07:59Z")

</div>

i did those nodes. To clarify, im trying to figure out how did you get the ‘enemy class variable’ to display two class references. so far, this is my variable tab  
 ![image_2025-02-08_150755718](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/5/3/2533c12d64220b9d26d3a227b13b19421f17df73.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [February 8, 2025, 8:44pm UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323/10 "2025-02-08T20:44:49Z")

</div>

When you drag your ‘enemy class’ variable into the graph, it will ask ‘get or set’, you choose set, and you get this

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/4/d/c4dfa86d7d1c918e2efe32b5b42203d4de478435.png)

then you just drag from the left, like I did in the GIF right above here 🙂

Or maybe you mean this bit?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/b/1/2b1a125145d2b484ed4961a95c52c921bb6fc5d7.png)

Please watch the GIF, I dragged from the variable and typed ‘=’

---

<div class="post-metadata">

**Author:** ![ybenjamin0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ybenjamin0](https://forums.unrealengine.com/u/ybenjamin0)\
**Post date:** [February 8, 2025, 10:49pm UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323/11 "2025-02-08T22:49:42Z")

</div>

is ‘enemy type 2’ a child and ‘enemy type 1’ is the parent? i went to the right ride of the event graph to the default value list and discover how to make another enemy for the variable to display the two type enemies. Is this was the correct way to do that? for me, that did the trick!

---

<div class="post-metadata">

**Author:** ![ybenjamin0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ybenjamin0](https://forums.unrealengine.com/u/ybenjamin0)\
**Post date:** [February 8, 2025, 10:58pm UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323/12 "2025-02-08T22:58:39Z")

</div>

i have a quick question about the level blueprint. One of the enemies ive created is supposed the follow the player then destroy itself after touching the player, but ever since coding this spawner blueprint into the level blueprint, the enemy code doesn’t properly work anymore. It only follows the player but it doesn’t destroy. Is it a possibility that the level blueprint can affect the enemy event graph nodes? The spawn points itself? Or that the destroying enemy is a child?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [February 9, 2025, 8:32am UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323/13 "2025-02-09T08:32:52Z")

</div>

Because we made the ‘enemy class’ variable by right clicking on the spawn node, it’s type is ‘actor’. So you can assign it to any type.

Can you show me the code for destroying when you reach the player?

---

<div class="post-metadata">

**Author:** ![ybenjamin0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ybenjamin0](https://forums.unrealengine.com/u/ybenjamin0)\
**Post date:** [February 9, 2025, 11:43pm UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323/14 "2025-02-09T23:43:15Z")

</div>

![image_2025-02-08_201705979](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/2/7/227408165389293afff6575e75f324059ad831e4.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [February 10, 2025, 6:45am UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323/15 "2025-02-10T06:45:16Z")

</div>

Yes, looks ok, not sure what the problem is there… 🤔

---

<div class="post-metadata">

**Author:** ![ybenjamin0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ybenjamin0](https://forums.unrealengine.com/u/ybenjamin0)\
**Post date:** [February 11, 2025, 3:24am UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323/16 "2025-02-11T03:24:09Z")

</div>

im not sure either. that code is within the enemy’s own event graph

---

<div class="post-metadata">

**Author:** ![ybenjamin0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ybenjamin0](https://forums.unrealengine.com/u/ybenjamin0)\
**Post date:** [February 12, 2025, 2:59am UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323/17 "2025-02-12T02:59:28Z")

</div>

can it be that its being reference in the level blueprint? Or that both the enemy blueprint and the level blueprint can override (or cancel out) each other can one works over the other and not at the same time?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [February 12, 2025, 1:35pm UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323/18 "2025-02-12T13:35:46Z")

</div>

Debug is the name of the game.

Put print strings everywhere. Are they really overlapping, is the destroy call actually being made, etc…

---

<div class="post-metadata">

**Author:** ![ybenjamin0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ybenjamin0](https://forums.unrealengine.com/u/ybenjamin0)\
**Post date:** [February 15, 2025, 1:59am UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323/19 "2025-02-15T01:59:39Z")

</div>

ok ill see that to help me see whats causing it. thanks!

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [March 17, 2025, 1:59am UTC](https://forums.unrealengine.com/t/how-to-branch-two-spawning-patterns/2318323/20 "2025-03-17T01:59:40Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
