1
\$\begingroup\$

I'm a veteran C++ dev, but so far I've only been working with blueprints in Unreal. I'm now attempting to mix the two.

I have a blueprint actor I'd like to attach a component to, but the actor component is defined as a C++ class. The class doesn't show up in the editor as an addable component. As far as UE5 is concerned, that class doesn't exist (even though I used "Tools->New C++ Class" to create it).

I have "meta=(BlueprintSpawnableComponent)" in the UCLASS definition at the top of the header. So far, everything is just as UE generated it - no changes.

I've tried building the solution through VS and also restarting UE to no avail. I noticed the .cpp and .h for the new class weren't included in the VS solution by default, so I had to add them manually. That also did not fix the problem. I'm getting roughly 10k errors when I try to build in VS, but it's my understanding that I should ignore those.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

Apparently the VS solution has to be regenerated, and it's done via windows explorer and not the unreal editor. I right clicked the UE5 project file and selected "Generate Visual Studio Project Files". I had to install a .net runtime I was missing before it would work. Afterward, I was able to find the class in UE5 and add the component to the actor.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .