UPDATE: The issue came back again. If my PlayerControllerBP has a Cast to <BP derived from CharacterBP>, it nulls out the mesh. As soon as I remove that cast, it fixes it.
UPDATE 2:
They were able to reproduce the bug, and in my case it was due to a circular dependency:
[]
Hi ,
Upon further analysis, we found a circular dependency in your blueprints, which is causing this specific issue:
…]
We are currently working on a fix for circular dependencies in blueprints. In the mean time breaking this circle should remove the error you are experiencing.
[/]
ORIGINAL:
I figured I’d share a bit of a nightmare I went through recently with blueprints. I’m on 4.5, and I don’t remember if I tested this in 4.4, but I spent maybe 12 hours trying to understand a problem I came across.
The problem: Game works like a charm in editor and editor launched standalone. I packaged a development build, and before sending it out, I tested that build. Welp, game was no longer working like a charm. My character blueprint was completely broken in the packaged version of the game.
The… the cause? I spent maybe 4 hours trying to figure out what was going on, and as I delved deeper into the problem which I began to suspect less and less was my fault. I discovered that when I removed any blueprint paths to nodes referencing my character blueprint (like Cast to MyCharacterBP or Find All of Class), the character worked. Note that these nodes weren’t even being executed when the character was broken. The mere fact they that they were being compiled was wrecking the packaged version of the blueprint they referenced.
So at that point I’m pretty certain it’s Epic’s fault because these blueprints had worked before in package release yet all my changes were pretty much innocuous. What I needed to know is what I had done that brought about this issue so I could avoid it in the future. I went back to previous commits and started packaging my game at every commit to see where things went south. I found the commit, started diffing blueprints and C++, and began removing other changes in it, changes that shouldn’t really have had any effect on my blueprint (I list them below), and it turns out they didn’t. So I had the commit but after going through most every change, I was about to give up.
Anyway, while trying to fix this issue by simply cleaning up my blueprints, I had discovered my blueprint’s context menu wasn’t giving me all the functions I should have access to. So I googled that issue and discovered thisanswers.unrealengine.com/questions/111211/having-lots-of-problems-with-blueprint-context-men.html ask thread. At this point I was only trying to fix the blueprints context menu, and Ben’s response to turn on the experimental menuing system did in fact fix the context menu for me. I then repackaged the game - not because I thought the menu would fix it but because at this point I had been repackaging on every change.
And completely unexpectedly my character blueprint was working again in the packaged game… with references to the class still in use in the blueprint. I immediately tried to re-break my character blueprint by disabling the experimental menuing system, but this time the character still worked in the packaged release.
The only thing I think could have happened was: I turned on experimental menuing at some point to test it, and then went back to the legacy system. Doing this somehow messed with the integrity of blueprint compilation (honestly this sounds like total nonsense to me, but it’s the only idea I have right now), and when I switched back to the experimental menuing system again it corrected whatever was wrong with blueprint compilation before.
What my bad commit included (possibly irrelevant):
- I changed the header file that my blueprint’s parent blueprint derives from. So MyCharacterBP->MyParentCharacterBP->MyGrandaddy.h. I added a reliable NetMulticast RPC and a BlueprintImplementableEvent to MyGrandaddy.h.
- I also added a new object type to the collision settings that just happened to share the name of a replicated variable on my character BP. I was losing my mind by the time I thought this could be the culprit.
- I also added some ForceNetUpdates to PlayerStates and Controllers in MyGameMode.h.
- Had server handle whether or not a player could move.
- Added more configurable variables to the MyGameMode.h and had MyGameModeBP access them.