There is an issue after importing from 4.16 to 4.17 that causes an Actor’s ActorComponents to reset instance variables to their defaults, when the actor is referencing a variable from the actor component.
To reproduce:
-
In engine version 4.16 create a BP_ActorComponent blueprint (parent of ActorComponent). Give it a bool variable called bDefaultOn, make it instance editable. Compile and set its default value to be true. Also give BP_ActorComponent a vector called “SomeVector.”
-
Create a BP_Actor blueprint (parent of actor). Assign it a BP_ActorComponent created above. Create a function called SomeFunction, that takes in a vector, and just outputs it to a log or something
-
In BP_Actor, override the Hit Event. Drag a pin from the Hit event and call SomeFunction. Get a reference to the actor’s BP_ActorComponent, then from that get a reference to SomeVector. Use the reference of SomeVector as the input to SomeFunction.
-
Drag an instance of BP_Actor to the map. In that instance, change the bDefaultOn bool var in that instances BP_ActorComponent to false.
-
Compile, Save All, and close.
-
Switch the project to engine version 4.17
-
Open the project
-
Observe that the instance actor on the map still has its BP_ActorComponent’s DefaultOn var set to false.
-
Compile the BP_ActorComponent blueprint. Observe that the instanced actor’s BP_ActorComponent’s bDefaultOn variable is now true/on.
Ive been able to repeat this also with variables stored in blueprint objects. Also, compiling the BP_Actor does not seem to cause this, just compiling the actor component.