Building forgets variables/arrays

Dear reader,

I’m facing (again and again :smiley: ) strange behavior.

This time it is that UE4.10.2 “forgets” my set variables.

In my level I have an Actor that saves some information that is needed in my level.

When I now “Package Project” (doesn’t matter if 32 or 64 bit) only the first (in my opinion the 3rd and the 5th) variable in my array is working ok, the others (I think 2nd, 4th and 6th) are deleted, forgotten, whatever.

In Editor, when “Play Selected Viewport”, it is working.
In Editor, when “Play Standalona”, it has same behavior than in “Build” - so I’m thinking there is some mistake on my side.

My Array is a set of Actors in my level, so I’m sure that those are correct and set.

Any idea why this happens?

Many thanks.

Best,

Tigger

Maybe this helps to understand:

As you can see Checkpoint/2/3 is in array on 0,2,4 and Checkpoint709/1597/1779 on 1,3,5 …

So the order is set. My BP code tells to switch from 0 to 1, 1 to 2 and so on after my character BP has touched.

As said before in editor play this works fine.
But in “Standalone” or at build version only array(0) is working and my BP code is not switching it to array(1).

From time to time after reloading the level it looks like this:

So I’m pretty sure that something with build and/or editor isn’t working properly.

Any idea?

Many thanks.

P.S.: Maybe this is more an Bug of UE4!? If so please move my threat to there. Many thanks.

Hello Magic Trigger,

Could you post the code or blueprints where you’re setting this array up? Based off the numbers of those instances, it seems like they’re being generated by something rather than being placed directly in the level. Is this the case? That could be part of (not the root) of the problem. The more details you can give about the problem, the easier it will be to track this down.

Dear ,

as my complete project is at the moment on your (Epic) side (at Sean Flint) I’ll try to contact you in forums and send you the link with further informations.

As you can see, there is an Actor and as shown above the variables in the array are only set in “level screen”.

Looking forward to your answer.

Many thanks.

Do you set the elements of this checkpoint array manually instead of have it be filled in part of the blueprint? If so, this is where the problem is arising. Since you create the checkpoints that are attached to the HurdleWithPoles objects as part of the Construction Script, they’re being remade every time the construction script is called, which will happen when they are edited but also when launched in a standalone game. Starting a PIE session in the Selected Viewport doesn’t call the construction script and thus the same checkpoint instances are being used.

You’ll need to either create these checkpoints outside of the construction script so that they don’t get replaced or have the checkpoints array filled with these checkpoint references at runtime.

Aw! Yes! I put the cart before the horse. :confused:

Solution is that I need to use my Checkpoint Blueprint as Parent and have the HurdleWithPoles as Child! There is no need to “Program/Blueprint it by myself”!)

Many thanks!

That helps lots!