I’m using a binary UE 4.12.0 Preview 4 build. When I create an animation blueprint reference variable in the actor blueprint that owns it, and then set it in the actor’s construction script, a new animation blueprint instance is created instead of a reference to the current animation blueprint.
Repro steps:
-
Create a new ThirdPersonCharacter blueprint project for testing.
-
Open the ThirdPersonCharacter blueprint and add a new variable of type “Third Person Anim BP Reference” called “MyAnimBP”.
- Set this variable from the character construction script as follows:
- If you Simulate (Alt+S) and open the ThirdPerson_AnimBP, you’ll see two instances under Debug Filter:
- The problem can be also be shown by adding the following nodes to the character event graph:
-
Play the game and move the character. Notice that a speed of zero is always printed on screen. This is because our AnimBP is new instance instead of the character’s instance.
-
The problem does not happen if instead of setting the variable during construction, we set it during Begin Play. Remove the construction script nodes and add the following to the event graph:
- Play the game again and see that the speed is now printed properly. So the problem happens with construction script only.