Blueprint bug absent from editor and present in both shipping/development packages

Hi everyone,
I’m having troubles with this one bug. In a level, when a player collides with a trigger zone, he can chose letters to form a word and resolve the situation. This is done by casting a ray (LineTraceByChannel) from the player to the letters collider, which activates an icon in the HUD signaling you can pick it put, by pressing the interacting key.
What I’m doing is checking the name of the mesh the ray collides with, and if it matches the name of any letter, it means the character is looking at it and thus can pick it up.

It works without any kind of problem in the editor. But when packaging, and entering this trigger zone, the player can only interact with one letter, something I can’t recreate in the editor. The other letters are unresponsive, as in they don’t trigger the HUD to appear, nor can you pick them up with the interacting key.

It seems to be tied to the order in the blueprint. The one letter the player can interact with is the first letter in my blueprint. Here’s a picture to explain my point better So why would it be that the full sequence works in my editor and in standalone game mode, but not when packaging?

Thanks for your time!

Get Display Name is only for debugging, it will give different results in PIE and packaged games. No idea how you set it up but if you’ve got one main letter blueprint and a bunch of those in the level you can add a name variable of your own and set that per instance, then check that instead.

Thanks for your most interesting answer! I was going quite crazy on this. The letters are meshes directly placed in the level, of which I check the display name the way you saw. How exactly could I have my blueprint identify them in a way that wouldn’t differ in editor and package? The name variable sounds good, but I’m having trouble figuring out how to set it up. I’ll look into it.

EDIT: Nevermind, I found a way to fix this, by getting the object name instead of the display name, and making sure it matches the ID of my meshes! A great thanks to you!

Never use object names for game logic. You can never know exactly what objects will be named. In your letter Blueprint, create a FName variable and give each letter a unique value, then use that for comparison.

Hey, at the moment I’m using the Get Object Name and making a comparison with objects IDs. It seems to work in a stable way, but I’m always willing to make it better. How would I give each letter a unique value? For now they’re placed in the level as meshes, not in the blueprint. Do you mean I should get these meshes and give them a value through an unkwown function? Wouldn’t it be better if the letters were part of the blueprint, so that I can make comparison way easier, as the letters would be components of the blueprint?

Make each letter a Blueprint that has a “LetterName” variable.

Alternatively, you can just use the built-in tags system.

Blueprints are probably better. For example if you only need to know if you hit a letter type object you can create a BP_Letter, put a bunch of those in the level and change the skeletal/static mesh for the instances. You could remove the name checking stuff and replace it with a cast to BP_Letter, if it succeeded continue with the logic. This way you could use all of the letters in the alphabet without having a ton of branch nodes.

Then if you needed to know which letter it really was you can create a new variable in the BP, change the type to name or something, set it to be exposed by clicking the eye icon and editable in the settings to the right, then in the level there’s a field where you can set a name for each instance.

I tried tags but in a stupid way, after reading your reply I checked again and the function “Actor has tags” is the right one, isn’t it?

I think it’d be a lot easier with the tag system, cause having a blueprint for each letter would require a total of twenty blueprints or something all coordinating. While this is feasible, it sounds like a waste of time compared to tags or IDs.

On another note, do you really think the ID of the object can change? I mean, I migrated the project two times, I built and arranged countless times, and still, when I go back to previous iterations, the letters meshes all have the same IDs in each project. Doesn’t that mean they’re quite stable? Legit curious here.

You would only need a single blueprint type with 20 level placed instances. With tags you would have the same thing so there’s no difference.