Spawn tile at attach point

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!

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.

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?

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

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

Thankyou!! solved my problem!

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

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

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 Forums4-Object%26_Class_Variables

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.

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

http://https://snag.gy/2Csglz.jpg