line – Unreal c ++ Call a void from an actor with LineTrace

Im new to C ++ (use in C #) and try to call a void on an actor when he is hit by a raycast and send him the cords.
Heres the script header that tries to call "EditMesh" (near the bottom)

    #pragma once
#include "CoreMinimal.h"
#include "GameFramework / Actor.h"
#include "ProceduralMeshComponent.h"
// # include "Core.h"
#include "Chunk.generated.h"




UCLASS ()
class VOXELWARS_API AChunk: public AActor
{

GENERATED_BODY ()

public:
// Set the default values ​​for the properties of this actor
AChunk ();

protected:
// Called at the beginning or the birth of the game
virtual void BeginPlay () override;


public:
// Called each image
// virtual void Tick (float DeltaTime) override;

// UPROPERTY (EditAnywhere, BlueprintReadWrite, Category = Default)
// UMaterialInterface * TheMaterial;
UPROPERTY (EditAnywhere)
AChunk * ChunkRef;

UPROPERTY (EditAnywhere)
class UMaterialInterface * OnMaterial;

UPROPERTY (VisibleAnywhere)
UProceduralMeshComponent * mesh;
UPROPERTY (VisibleAnywhere)
int faceCount = 0;
tarray the tops;
UPROPERTY (VisibleAnywhere)
tarray triangles;
tarray the normals;
tarray UV0;
tarray tangents;
tarray vertexColors;
tarray blocks;

int worldData[16][16][16]    = {{}};
float tUnit = 0.0625;


public: void CubeTop (int x = 0, int y = 0, int z = 0, int block = 0);
public: void CubeNorth (int x = 0, int y = 0, int z = 0, int block = 0);
public: void CubeEast (int x = 0, int y = 0, int z = 0, int block = 0);
public: void CubeSouth (int x = 0, int y = 0, int z = 0, int block = 0);
public: void CubeWest (int x = 0, int y = 0, int z = 0, int block = 0);
public: void CubeBot (int x = 0, int y = 0, int z = 0, int block = 0);
public: empty cube (FVector2D texturePos);
public: void UpdateMesh ();
public: void ClearMeshData ();
public: void GenMesh ();
public: void EditMesh (int x = 0, int y = 0, int z = 0, int block = 0); //right here

public: int Chk (int x = 0, int y = 0, int z = 0);
// int * mBlock (int x = 0, int y = 0, int z = 0);
};

And here is some of the cpp from the other script that I want to call EditMesh () with

                                #include "Chunk.h"
#include "VoxelWarsCharacter.h"
#include "VoxelWarsProjectile.h"
#include "Animation / AnimInstance.h"
#include "Camera / CameraComponent.h"
#include "Components / CapsuleComponent.h"
#include "Components / InputComponent.h"
#include "GameFramework / InputSettings.h"
#include "HeadMountedDisplayFunctionLibrary.h"
#include "Kismet / GameplayStatics.h"
#include "MotionControllerComponent.h"
#include "XRMotionControllerBase.h" // for

voW AVoxelWarsCharacter :: OnFire ()
{
FVector StartLocation = GetActorLocation (); // your location
StartLocation.Z + = 15;
FVector EndLocation = StartLocation + (FirstPersonCameraComponent-> GetForwardVector () * 4000.f); // get forward dir
FHitResult Hit;
FCollisionQueryParams ColParms; // ignoring
ColParms.AddIgnoredActor (this); // do not know how to hit

GetWorld () -> LineTraceSingleByChannel (Hit, StartLocation, EndLocation, ECC_Visibility, ColParms); // ECC_WorldDynamic will only appear in Actors, ECC_Visibility is everything.

if (Hit.GetActor ()) {
//Hit.GetActor()->AChunk::EditMesh(0, 0, 0, 1);
GEngine-> AddOnScreenDebugMessage (-1, 5.f, FColor (255,255,255), "Hit an actor");
UKismetSystemLibrary :: DrawDebugLine (GetWorld (), StartLocation, Hit.Location, FColor (255, 255, 0), 5, 1); // FColor :: Red

Hit.GetActor () -> FindComponentByClass() -> EditMesh ((int) Hit.Location.X, (int) Hit.Location.Y, (int) Hit.Location.Z, 0);
// how can i do this ?????????
}
}

Errors I receive

CompilerResultsLog: Error: D: ProgramFiles Epic Games 4.19 UE_4.19 Engine Source Runtime Engine Classes GameFramework / Actor.h (2640): Error C2338: Model Parameter & # 39; T & # 39; of FindComponentByClass must be derived. UActorComponent CompilerResultsLog:

Error: C: Users nolan Office VoxelWarsUR Project VoxelWars Source VoxelWars VoxelWarsCharacter.cpp (160): Note: See the reference to the function template instantiation & # 39; T
* AActor :: FindComponentByClass (void) const while compiling