How to call constructor of ACineCameraActor?

Hi all!
I want to know that how to call constructor function in ACinemaCameraActor.

 -----------------------------------------.h-----------------------------------------------------   
    UCLASS()
    class MyAPI AMyCineCameraActor : public ACineCameraActor
    {
    	GENERATED_BODY()
    
    public:
    	AMyCineCameraActor();
 -----------------------------------------.cpp-----------------------------------------------------   
    AMyCineCameraActor::AMyCineCameraActor() "{ "<=== here error
    	PrimaryActorTick.bCanEverTick = true;
    }

Error message : No default constructor exists.
Thank you.

Constructor is automatically called every time an instance (an object) of that class is created.

This constructor should work:

     AMyCineCameraActor::AMyCineCameraActor() 
     {
         PrimaryActorTick.bCanEverTick = true;
     }

Happy coding :slight_smile:

Thank you!
Is That means we don’t have to include constructor in headers?

The declaration of the constructor MUST remain in the header.

*.h file

// ...
public:
    AMyCineCameraActor();
// ...

*.cpp

 //...
 AMyCineCameraActor::AMyCineCameraActor() 
 {
     PrimaryActorTick.bCanEverTick = true;
 }
 //...

This code will be called every time you spawn an object from this class or place it in the editor.

Since it seems that you are new to C++ here is an article about the header files and what should they contain.