# Spawn tile at attach point

**URL:** <https://forums.unrealengine.com/t/spawn-tile-at-attach-point/339358>\
**Category:** Blueprint\
**Tags:** endless-runner, tiles, unreal-engine, UE4, Blueprint, question\
**Created:** [November 22, 2015, 9:21pm UTC](https://forums.unrealengine.com/t/spawn-tile-at-attach-point/339358 "2015-11-22T21:21:45Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![iProspartan117](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iProspartan117](https://forums.unrealengine.com/u/iProspartan117)\
**Post date:** [November 22, 2015, 9:21pm UTC](https://forums.unrealengine.com/t/spawn-tile-at-attach-point/339358/1 "2015-11-22T21:21:45Z")

</div>

Hello, i’am following the endless runner with blueprints tutorial and i’am stuck at the 2nd video… at 7.22.  
All my tiles are spawning on top of eachoter. So somehow the spawnpoint for every next tile is not set right. I’am already trying to fix it for like 1,5 hour. But i still can’t find the problem…  
annyone who has a fix?  
thnx!

---

<div class="post-metadata">

**Author:** ![iProspartan117](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iProspartan117](https://forums.unrealengine.com/u/iProspartan117)\
**Post date:** [November 22, 2015, 9:23pm UTC](https://forums.unrealengine.com/t/spawn-tile-at-attach-point/339358/2 "2015-11-22T21:23:13Z")

</div>

They do not really spawn on top of eachother. But more like inside eachoter. So when i try to spawn 10 tiles, i only see 1.

---

<div class="post-metadata">

**Author:** ![Alderbit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Alderbit](https://forums.unrealengine.com/u/Alderbit)\
**Post date:** [November 22, 2015, 10:34pm UTC](https://forums.unrealengine.com/t/spawn-tile-at-attach-point/339358/3 "2015-11-22T22:34:15Z")

</div>

Hi iProspartan,

It’s hard to know what the problem is without seeing your work, but you might double check a few things:

- Is AttachPoint in the floor tile blueprint positioned correctly?
- Is GetAttachTransform returning the AttachPoint’s transform?
- Is AddFloorTile updating NextSpawnPoint with the return value of GetAttachTransform?

---

<div class="post-metadata">

**Author:** ![iProspartan117](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iProspartan117](https://forums.unrealengine.com/u/iProspartan117)\
**Post date:** [November 23, 2015, 8:00pm UTC](https://forums.unrealengine.com/t/spawn-tile-at-attach-point/339358/4 "2015-11-23T20:00:18Z")

</div>

Hi Alderbit,

sorry for my late responce, i have been verry bussy with work.  
To awnser your questions:

- the AttachPoint is positioned correctly
- The GetAttachTransform is returning the AttachPoint’s transform(but it seems that this is not working because they spawn inside of eachother.
- AddFloorTile is updating NextSpawnPoint with the return value of GetAttachTransform

 ![67851-2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/3/9/539f7523a3856d967150a5fbbc536b41e7b2d189.png)

---

<div class="post-metadata">

**Author:** ![Alderbit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Alderbit](https://forums.unrealengine.com/u/Alderbit)\
**Post date:** [November 24, 2015, 12:13am UTC](https://forums.unrealengine.com/t/spawn-tile-at-attach-point/339358/5 "2015-11-24T00:13:56Z")

</div>

In the AddFloorTile function, you accidentally made NextSpawnPoint a local variable. Recreate it as a class variable and everything should work.

---

<div class="post-metadata">

**Author:** ![iProspartan117](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iProspartan117](https://forums.unrealengine.com/u/iProspartan117)\
**Post date:** [November 25, 2015, 11:46am UTC](https://forums.unrealengine.com/t/spawn-tile-at-attach-point/339358/6 "2015-11-25T11:46:25Z")

</div>

Thankyou!! solved my problem!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_47e776ca](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_47e776ca](https://forums.unrealengine.com/u/anonymous_user_47e776ca)\
**Post date:** [September 17, 2016, 8:15pm UTC](https://forums.unrealengine.com/t/spawn-tile-at-attach-point/339358/7 "2016-09-17T20:15:39Z")

</div>

I have the same problem. Everything is correct as far as scripting but the tiles still spawn within each other/

---

<div class="post-metadata">

**Author:** ![NikanM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NikanM](https://forums.unrealengine.com/u/NikanM)\
**Post date:** [July 14, 2017, 5:00pm UTC](https://forums.unrealengine.com/t/spawn-tile-at-attach-point/339358/8 "2017-07-14T17:00:51Z")

</div>

Could you please help me I don’t know how to recreate it as a class variable

---

<div class="post-metadata">

**Author:** ![iProspartan117](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iProspartan117](https://forums.unrealengine.com/u/iProspartan117)\
**Post date:** [July 17, 2017, 7:34pm UTC](https://forums.unrealengine.com/t/spawn-tile-at-attach-point/339358/9 "2017-07-17T19:34:24Z")

</div>

Check this link, i’m sure you can find the information there… as of now this has been such a long time ago for me that i don’t remember the exact steps i took to fix the issue.

[A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums](https://wiki.unrealengine.com/Blueprint_Essentials_-)_4_-_Object_%26\_Class\_Variables

---

<div class="post-metadata">

**Author:** ![iProspartan117](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iProspartan117](https://forums.unrealengine.com/u/iProspartan117)\
**Post date:** [July 17, 2017, 7:38pm UTC](https://forums.unrealengine.com/t/spawn-tile-at-attach-point/339358/10 "2017-07-17T19:38:27Z")

</div>

Excuse me, by looking at the screenshots i remembered.  
There are two types of variables in Unreal. Local variables and class variables.

if you look at my initial attachment 2.npg, in the “My blueprint” section on the left, you see that NextSpawnPoint is located under the Local variables tab. You have to put it under the “variables” tab, where you see the defualtSceneRoot component and NewVar\_0.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![micwanyoike](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@micwanyoike](https://forums.unrealengine.com/u/micwanyoike)\
**Post date:** [June 20, 2018, 1:00pm UTC](https://forums.unrealengine.com/t/spawn-tile-at-attach-point/339358/11 "2018-06-20T13:00:53Z")

</div>

I cam across another issue where the spawned objects had incorrect scale. This is the fix I found:

[http://https](http://https)://snag.gy/2Csglz.jpg
