I have a plugin with an actor component in it with a function DoThis();
In my project, I created a new actor with no real function and I just want it to refer to my actor component and run the function.
I added my plugin to my ProjectReference in the main project build.cs but I still cannot call it.
It is also present in the .uproject file.
What are all the requirements to successfully call it in C++ and compile?
class UmyCustomComponent* myInstantiatedComponent;
3rd call its function in the cpp file
myInstantiatedComponent.MyFunction();
That’s it . Since components are only single instance (I think )
Just declaring in the header or just getting component from the main actor is enough to get the reference to the custom component .
Edit 1:
By the way, components are not single instance in an actor.
To get all of them, use GetComponents()