Spawning object to a certain place in another level

I’m not an advanced programmer and I have used Unity and C# before. Last week I started to use Unreal Engine, so working on it and learning the Blueprint-system has given a little challenge.
Anyhow, I have a problem which I don’t seem to solve myself. I have two levels in my project; in the first level you’ll be able to put a spotlight object on a map, and then when you’re changing levels, that spotlight should be on there in the place where you just put it.

I have got the object to spawn in the other level, but getting the transform information for it has been a challenge.

So this is the BP for the spotlight. The content in the red box doesn’t work. The transform is correct in Make Array node, but in the Set node it says that Variable is not in scope. Which is funny, since it can still find it in that Transform Function. :open_mouth: So it can’t set the value in the variable New Spotlight Transform Array.

And here is the Level BP for level #2. It doesn’t give the error Variable not in scope, but the value for everything is always 0,0,0.

121602-kuva3.png

The BP and New Spotlight Transform Array variable in GameInstance. The variable is public, I’ve checked it many times.
So what on earth could be the problem? Why it doesn’t set the transform info to the array that’s located in GameInstance?

Ok, I never spawned did that but what I see:

  1. In the First Sreeccapture, you use get your Transform values (your get them seperate and add them to one transformation, just “getWorldTransform” would work too) and make them to an array. Then you take this Array and set it to “NewSportlightTransFormArray”. in Code it would be like:

    NewSportlightTransFormArray = new empty Array;
    makeArray = getWorldTransform;
    NewSportlightTransFormArray = getWorldTransform;

You don’t need the “set” operatior, rather the “add” operator.

  1. In the secound Level (Capture 2) you call “AtBeginPlay”, you should call it after your Level is loaded.

Yes, I got it working! There was a bit more to do too, but you gave me a huge bump forward. Thank you! : )