Might help others,
I was wondering why in Sam’s example his compiled fine just declaring
UFUNCTION(Server, Reliable, WithValidation)
void Server_MoveForward(float Val);
UFUNCTION(Server, Reliable, WithValidation)
void Server_MoveRight(float Val);
Where I was having to explicitly declare everything where I was trying to figure out the errors myself before following along when the doc’s say you dont need to.
UFUNCTION(Server, Reliable, WithValidation)
void Server_MoveForward(float Val);
virtual bool Server_MoveForward_Validate(float Val);
virtual void Server_MoveForward_Implementation(float Val);
UFUNCTION(Server, Reliable, WithValidation)
void Server_MoveRight(float Val);
virtual bool Server_MoveRight_Validate(float Val);
virtual void Server_MoveRight_Implementation(float Val);
Turns out if you have the additional declarations commented out in the header file it confuses the compiler (4.26 (visual studio 2019)) like example like below where I had been testing and you get loads of errors, you have to delete the commented out lines so it is just the two UFUNCTIONS as the first code comment above then it all works fine.
So if you are getting errors and have something like the below try deleting the comments (weird but I can reproduce it 100%)
UFUNCTION(Server, Reliable, WithValidation)
void Server_MoveForward(float Val);
//virtual bool Server_MoveForward_Validate(float Val);
//virtual void Server_MoveForward_Implementation(float Val);
UFUNCTION(Server, Reliable, WithValidation)
void Server_MoveRight(float Val);
//virtual bool Server_MoveRight_Validate(float Val);
//virtual void Server_MoveRight_Implementation(float Val);