ConstructionScript isn’t firing in Preview but does in StandAlone.
I have an actor blueprint placed in the level and the ConstructionScript is not firing. I’ve used print string to test but that’s not displaying, and I don’t see the orange animation fire across the nodes either.
It does seem to work as a StandAlone game but I still don’t see the orange animation.
What’s also weird, is this was working days ago and I haven’t made any changes.
All I’m doing is finding other actors that are already placed using a function blueprint, and assigning those findings to variables.
After more testing I’m also wondering if things are even firing in order now. I have a blueprint called bpSaveHelper placed in the level, and from the level blueprint I’m making a call to bpSaveHelper, telling it to load save files. Then in another actor placed in the level the ConstructionScript tells it to read the save files. In the past this worked fine. The save files were always loaded before any of the other placed actors ran their construction script. I’m finding now this doesn’t appear to be the case, and other placed actors might be firing their ConstructionScript before the level blueprint.
Could you provide some screenshots of how you have your blueprint set up?
Does your setup work properly if you use it on begin play?
When you say it was working days ago, do you mean the setup with finding other actors that are placed, or just that the construction script was firing?
Hello, I modified the entire code because I needed an immediate solution due to meeting a timeline. That being said I cannot provide you a screenshot of all the previous blueprints.
But here is a better description of my findings:
ConstructionScript is firing on newly created actors but not ones that are already placed in the level.
ConstructionScript was working on already placed items only a few days ago. No changes were made to the construction code. I only noticed it suddenly wasn’t working because I began to receive errors since crucial task weren’t executing.
After the problems started to occur I found Pressing Play as a Standalone game would fire the ConstructionScript on already placed actors, but in preview mode would not.
Most of my construction scripts would call a custom event within the actor blueprint which would make calls to a different function blueprint. I provided a screenshot of these.
Begin Play was firing but I needed all crucial task to happen before other blueprints used Begin Play. If Begin Play was called on some blueprints out of order bad things would happen.
Instead of using the ConstructionScript within each placed actors I made a new custom event within the level’s construction which loaded the crucial information manually within all actors.
I suppose in the end what happened was a good thing as I now have more guaranteed control over what order things load. It was just weird that it worked previously, but no longer does.
As this seems like a somewhat complex issue, and even potentially multiple issues, do you have any way that we can reproduce this on our end to see the problems that you were experiencing?
The construction script is mainly used for performing actions such as setting defaults and the like, things that you’d like to be performed before Begin Play is called. It may be more beneficial for you to attempt to set up something similar on begin play instead of in the construction script. Feel free to elaborate on what exactly you’re trying to accomplish if you feel like this won’t work in your case.
I wasn’t able to unbreak the problem so I doubt I could figure out how to reproduce it. As said it only seems to affect already placed actors, and not ones spawned as the game is played. Begin play wouldn’t work because I need all placed actors to have defaults loaded before any other actions are performed.
But none the less I was able to resolve it as I mentioned above using a work around. My solution seems to be more reliable in execution so I’ll just stick with that. Thanks for your replies.