Error: member access into incomplete type 'ULocalPlayer'

#include “Runtime/Engine/Classes/Engine/LocalPlayer.h”

Unless you included it already, this might help.
You class doesn’t know what a ULocalPlayer is, and how to cast to it, without including it first.