All Code works Fine in Editor but not in Standalone Game mode

When I launch Into standalone Game mode and I pickup a key that has the same variable " text array " as my door the key is collected and actor is destroyed but the door still does not register the key has been picked up, but when I do the same In editor there are no issues at all and all the code works perfectly fine, I placed a print string on my code to debug and trouble shoot the issue with the output text on the print string as " NO KEY " so again in editor it works and door opens but in standalone mode I pickup the key and when i left click on the door the print string returns " NO KEY ".

Is there something I need to do on event begin play to fix this issue? or is it how it’s referencing the variables in the blueprints.

Any help at all will be greatly appreciated thanks in advance.

Can you show the code for the key pick up, and the door check?

So like I said the code works fine in PIE just seems to not detect I have a key in Standalone i tried debugging using print string but always the same " NO KEY "

In my level I placed this actor to detect picked up keys and store them so the game knows I have each type of key -

In my key pickup I have -

and for my door I use this -

There’s nothing really notable here, apart a slightly strange sequence of events.

Why not:

  1. When key is picked up, add it to the keychain.

  2. When door is used, check they have the key. Possibly also destroying it at the same time.

I mean, why add it to the key chain when the player is trying to use it? :slight_smile:

The reason I say this is, it could be some sort of timing issue, and I don’t really get the order of events…

I have a key chain as there are a lot of keys in the level for each locked door and if i have one key I’d just use level blueprint but because I have more than 10 doors each key gets added to the keychain.

I just don’t understand why it does not work in standalone but works perfectly fine in PIE … that’s the bit i need to figure out the blueprint has not failed me in PIE mode but the moment I load into Standalone it’s like the key chain and keys don’t exist.

It’s more likely a timing problem. Actors placed in a level, typically do also exist in the packaged version.

This is the bit I don’t get

You’re putting the key on the keychain, right as the player is trying to use it?

Surely it’s better to put it on the chain when the player picks it up?

So that’s the pickup key code, if i look at the key and press left mouse button it simulates picking up the key, the code to use the key is just a check in the door bp to see if i have it.

Ok, it’s the ‘open close’ that confused me… :slight_smile:

nar that’s just the name of my Blueprint interface lol, so the code above that you shared is just when you look at the key press left mouse and it picks it up

1 Like

I would start just putting debug code in. Does that keychain actor exist? Do some checks like that…

if you are using world partition with data layers, make sure all objects referencing each other are on the same data layer and runtime grid

No partitions but thanks for the input :slight_smile: it’s just a basic level not an open world or anything as such.

if you are saying you have many keys in the level your code is only getting index 0, if you have 10 keys it’s getting a random key with the GetAllActorsOfClass, also key master in the door isn’t being set anywhere I don’t think

I have it set up as a Text array so the key has a matching text array to the door thus enabling it to be opened as per the screenshots above.

not sure, try setting another GetAllActorsOfClass (key master) in the UnlockDoor event instead of using the key master ref, I suspect it’s being unset

So I moved the code into the first person character blueprint it worked again perfectly fine in PIE just not in Standalone