Variable Changing type randomly

This has become beyond infurating and has been hindering development for hours a time every time it occurs (5th time now).

The situation is, I have a master building blueprint that is extended from actor, lots of other buildings extend off of this.
The master building sets the player controller by casting to it and setting a player controller variable. The child building classes use this quite frequently.
I have a construction system which is a seperate blueprint which is speaking to master builder once it has spawned a building in the world.

My issue is, every now and then on a compile the player controller variable gets replaced with ‘PLACEHOLDER’ variable and it literally breaks everything (More things than just referenced by the player controller) in the project.
The way I have been fixing it, is copying out the changes into a notepad format, reverting back versions and pasting back in.

The logic works fine, there is no issue in gameplay runtime bugs until the editor randomly changes this variable to ‘Placeholder’ which breaks 4 blueprints, which once I fix those 4 the sytem still doesn’t work unless I revert the changes.

I have tried remaking the blueprints from scratch and now instead of placeholder, it is changing itself to ‘object’.

This is stupidly annoying as it’s such a weird bug, I have had it in both 4.9.3 and in 4.10. It’s literally putting a stop to our game development with no clear indication with what is going wrong.

I may have to try and cast a different way to get the owner (Right now it handled through lots of get owner pure functions that are assigned on building spawn).

It appears to be related to changing a structures properties when it’s being used by multiple other blueprints.
I have a struct of variables and then another structure of the previous structure turned into an array (great for lists of weapon and other objects that share structure details). Adding information to the second one breaks that information in a blueprint.

I have the same problem in 4.11.2

When I implemented a struct, obviously changed some data while editing some blueprints which use it and then restarted the editor, my whole game broke. The Tool-blueprint which used the struct changed all references to blueprints into PLACEHOLDER_CLASS and after recompiling the Tool-bluprint, it changed into an “Object”-reference. From now on, every time I restarted the editor, it would change the type again back to PLACEHOLDER and after compiling/saving to object-reference.

So basically, because I used a struct in exactly the way it was intended, I ended up having to reconnect about one hundred node-connections and I still don’t know if I’ll be able to get it running by today.

If i have time, I’ll try to recreate the steps, but I still need to reconnect about 40 nodes or so.

generally this ocurrs if the name of the structure is changed, or if the structure is moved (this happens sometimes, sometimes not), between source files.

And yes your right, repinning is the only cure. Adding to a structure I have never seen cause an issue, but renaming, yeah, that can hurt.


Ah, nice to know what exactly is causing the issue. Im done reconnecting and everything seams to work again.

I stopped using structures for the time being and use functions with lots of parameters as a workaround. ^^ I hope it will be fixed soon.

after reconnecting all pins, and restarting editor, everything breaks again. has anyone been able to pin point a way to save the repaired state as opposed to reopening the project and seeing everything break again? do i need to delete the struct? or is there a way to clean the project?

did you ever find a fix for this? my struct is a centralized way of saving various states of actors in the game, however now any attempt to use it corrupts the project. can’t figure out a workaround.

I was only able to solve the error by deleting all references to the struct in the blueprint and the struct itself. You could obviously create a new struct, just make sure not to move the struct or rename it as jayice said.

If you don’t want to risk having your project break again, you could use a class instead, as you would do in regular programming. (You sacrifice some performance though)

It would be nice, if Epic fixed this bug as soon as possibly.

Happens to me allot at random recently on variables that are being referenced by many Blueprints. Which is sad as a lot of things rely on that variable so game breaks are a pain. Oddly enough if you are not using replication I found a way around it using BP Communication vs direct calls. Its a pain ill agree. i usually have to delete the node and put in a new one to get it working again as long as you don’t change the name or compile after deleting the variable to replace it all other referencing blueprints should pick it right back up without a problem.

also i find it happens more when It is a custom variable on an Spawn node.

I put this up there with reroute nodes inheriting a variable type and refusing to or breaking connections if you change the variable type … like why ? it should just change but no you have to delete all of them and place new ones (Pull Hair)