Hello,
Looking at the following:
float AShooterCharacter::TakeDamage(float DamageAmount, struct FDamageEvent const& DamageEvent, class AController* EventInstigator, AActor* DamageCauser)
{
}
Some of the parameters in AShooterCharacter::TakeDamage() are passed by pointer and some by reference (and some by value). I can more-or-less understand the difference, but according to the first link below,
“If there’s ever a chance that you could want to pass “no object”, then use a pointer instead of a reference. Also, passing by pointer allows you to explicitly see at the call site whether the object is passed by value or by reference:”
These both seem like very good reasons to use pointers. Is there a reason why DamageEvent is passed in by reference?
(I’ve also included a second link I looked at when trying to work out the difference between passing by reference and pointer)