So I came across an error when trying to access Tank->:
float Distance = FVector::Dist(GetActorLocation(), Tank->GetActorLocation());
My code was correct, so i closed for the night and now this morning same error. So here is how i fixed it:
In UE5 IDE I went to Tools then clicked “rebuild visual studio project files”. After that i went into VS and removed all the Tank code lines in the Turrets.h and Turrets.cpp files. I then made sure i closed my UE5 IDE, and “Cleaned the solution” then “Rebuilt Solution”. After this i added back the Tank code i.e. the forward declare and distance math. It was then able to compile properly with no more errors!
I hope this helps someone else who also had this issue!