How to use GetComponetsByClass()?

Hey Guys,

I want to make this in C++ Adding a Hover Component | Live Training | Unreal Engine - YouTube

Ok so first I’ll make a UPrimitiveComponent after that I call in my cpp file GetOwner()->GetComponetsByClass(), but when ever I try to use this I fail…

For example if you try to get particle system component you do this

GetOwner()->GetComponentsByClass(UParticleSystemComponent::StaticClass());

You didn’t said what you “fail” is? how does it not work?

thanks! I want to get the PrimitiveComponent from the Actor to set PhysicsSimulation to true.

And how can I use the component which I get in my c++ code?