Can't initialize reference from Actor Component

Hello everyone!

There is my problem:
I use UE5.2 C++ Third Person Template.
I created empty plugin, and added new Actor Component to it.
I added my plugin to Build.cs of my project.
After that I added new-created component to third person blueprint (derived from c++ class).

I would like to get a reference to my actor’s component from animation blueprint, so I try to set variable (reference) in “Event Blueprint Initialize Animation”. But it says it is null.
At the same time, I can see this component in BP debugger (for Third Person BP), and reference (for animation BP) is null here too.


It is the same if I do cast and try to get my component in “Update Animation”.

You’re casting to a generic character, but the bullseye component is on BP_ThirdPerson?

1 Like

I don’t use cast, GetComponentByClass uses Actor as target.
I tried, with cast to BP_ThirdPerson it’s the same result.

1 Like

Strange, it works for me… as you have it…

To be fair, I got the collision capsule.

Dumb question, but is that code in the correct anim BP?

1 Like

Anim_BP is default from ThirdPerson Example.
It works well with Movement Component (as in default BP).
Now I tested it with Static Mesh component (I thought it was becouse of my plugin) - and it failed too.


May be just a bug…
I’ll try to recreate and simplify project.

1 Like

Ok!
I created new third person c++ project,
opened third person bp,
added static mesh component,
opened bp_anim and created ref for static mesh compoennt.
After that i used GetComponentByClass and set reference.
Also I recompiled project with Win64 Development editor configuration.
The result is the same :slight_smile:

1 Like