How to set root component for UActorComponent


So I am following this tutorial, where we simply created Actor c++ class, and in his video the class was like this public: AActor, and in my version it was like this public UActorComponent

So there are differences

But my main question is why is my version getting “identifier “Root Component” is undefined” ?

this is not AActor class, this is Actor Component class, we are using actor components like player stats, combat control etc. you need to create default Actor class