so I’ve got a simple setup of a base character and three characters that inherit from this one. Created them with “create child blueprint” and changed basically nothing except for the mesh’s material.
Now one child keeps losing the default mesh & animation blueprint.
When restarting the editor, this is what it looks like:
I then re-add the mesh blueprint by resetting the mesh to default(it keeps the correct material) and selecting the proper animtion blueprint and it looks correct afterwards:
the parent character has gameplay logic inside(both in its C++ baseclass as well as blueprint) as well as custom components:
Thanks to you I did look at the blueprint code and found some really weird stuff. I have a character select screen so whenever someone picks a new character, I do some initialization. Like this:
I noticed that the bug happens after a player selects a character, so it must have to do something with the code. Testing this was a real pain. I found out that it didn’t matter how many blueprints I created, it was always just one who got that bug.
Now “AddPlayer” seemed to cause the issue. Deleting it would in result the bug not happening. It looks like this:
So nothing really problematic. Here’s the weird thing, though: All I had to do was delete the call in the Event BeginPlay and then place the node again.
After doing this I’ve started the game and editor 10 times already and never got the bug. Even the blueprint icons are now fixed.
Any idea what this could be? Cache issue?
Anyway, thanks a lot for your answer. Brought me to the solution, but I’m still not sure what happened here.
1 bp_base (the bp has all variables controls and on construct sets variable and calls changes like material for the mesh.)
2 child for red
3 child for blue.
I deleted all the children since I had only one function in game mode that would override the pawn default class to either red or blue.
Then recreated children…
Been working fine so far multiple save exits and reloads.
Before if I saved and exited and came back the mesh and animation was lost.
It could be that at some point you had bad logic in the node and it was caching the old node and using it instead of the new node. This is why they have a “refresh node” option. I have had it happen to me a few times.
Glad it’s working for you though, sounds like just a ue4 quirk.
Nevermind it’s returned only one of the two children have lost its default mesh based on the parent. It’s just blank. Even has the button to make it default which is correct but save and exit and reload and it loses it again.
Yep same here, it’s just one. I’m pretty sure this is a bug by now and doesn’t actually have to do anything with the blueprint script. None of my changes have fixed it permanently.
because this bug didn’t go away even after updating to 4.13, I decided to further look into this. After a lot of trial & error, I finally found the reason this is happening and also a fix that works for me.
Whenever I assign the child actors to this variable(I use a class system for my game), some of them los their mesh. No idea why. Any other type of variable (Reference, asset ID or Class Asset ID) won’t do that. I don’t even have to anything. Just compile & safe, close and restart editor and the meshes are gone.
So as a solution, I’m using a Class Asset ID that I cast to the class with Load Class Asset.
Maybe others in this thread find this useful.
I’m not quite sure if this is a bug or a scripting issue. I couldn’t reproduce this outside of this tutorial setup.