Typically like you have done there, standard varioable types dont need pointers but majority of objects will. For example:
void Myfunction(AActor* MyActor, UStaticMeshComponent* MeshComp, UMaterialInterface* Material);
To access the function, variables in your function (inside the .cpp file ) use MyActor->GetName() instead of MyActor.GetName()
VS will autocorrect it for you when typing normally.