I have encountered a very strange phenomenon on my blueprint only project. The issue is that after reloading the project a specific variable (an array) loses its values which were properly set and working before closing the project.
It occurs in the following setup:
I have a character named Hunter which serves as a base class. This character has a variable named DeathMontages which is an array of Anim Montage Object References. In the actor blueprint this array is empty. I have created a child blueprint class name ShirtlessZombieHunter. This class contains the actual skeletal mesh and overrides some functions and it’s supposed to populate death anim montages suitable for the shirtless zombie. When I add concrete montages to the DeathMontages array, save everything, quit and then reopen the project DeathMontages array is still populated with montages set before.
So far so good. When I now start to use/reference my ShirtlessZombieHunter it gets weird. I have an actor named LevelSectionBase which represents dynamic level geometry and is also responsible for spawning hunters. In the current setup I just have a **Spawn Actor From Class" node where I set the hunter to spawn directly on that node. When I now select the ShirtlessZombieHunter as the class to spawn and reopen the project the weird thing is that the ShirtlessZombieHunter has lost all the values in DeathMontages, that is this array is now empty.
So basically using the ShirtlessZombieHunter at a Spawn Actor from Class node on another actor causes the ShirtlessZombieHunter’s DeathMontages array to be cleared.
I did some testing on this issue and found the following interesting things:
After selecting the ShirtlessZombieHunter in the Spawn Actor From Class node and quitting the editor only LevelSectionBase is changed when looking at git which makes sense. ShirtlessZombieHunter remains unchanged. Simply choosing another hunter as a class to spawn at this point doesn’t “heal” the ShirtlessZombieHunter. Only when I discard my changes on LevelSectionBase and then reopen the project the values in DeathMontages are there again. Please note: ShirtlessZombieHunter remains unchanged all the time.
Sorry for the long text but I find this behavior very strange and annoying. This all happens in the editor even without running the project. As soon as you reload the project, run as standalone or package the project, DeathMontages gets cleared when referencing ShirtlessZombieHunter in the Spawn Actor from Class node.
I am happy to provide more information if needed.