But I always get an error saying that this is not possible. Sorry if this is a stupid question, but I am really stuck and would really appreciate if someone could help me with this problem.
The question is actually awefully phrased and I appologize for that. I have made several attempts of fixing it, and the errors seem to end in the “headers”. This is the declaration of the function:
virtual void OnLanded(FHitResult& Hit);
And this the error I get: ‘void ACharacter::OnLanded(const FHitResult &)’ : no override available for virtual member function from base ‘ACharacter; function is hidden’. How am I able to fix this error?
In the header file, declare the function with OVERRIDE.
virtual void OnLanded(FHitResult& Hit) OVERRIDE;
Then, as Rama correctly said, use it in the source file like this:
void AFPSCharacter::OnLanded(FHitResult& Hit){
// make sure the parent class still does its things
Super::OnLanded(Hit);
// get dat Vec
const FVector disVec = Hit.ImpactPoint;
}
I have a feeling this, coupled with the correction that Rama mentioned, will fix it for you.
Okay so it turns out that I am still getting an error. Just to make sure, I am going to include this so that I can be certain that I have not done anything crucially wrong:
class AFPSCharacter : public ACharacter //this should allow it to work, right?
The error I am getting now is this:
‘AFPSCharacter::OnLanded’ : method with override specifier ‘override’ did not override any base class methods
Okay awesome! It compiled. I was also not aware that you NEED to include the “const” in front of the variables. Thanks for your help dude, I learned a lot.