Announcing Section #2 for Survival Game - Weapons & Interaction

TWeakObjectPtr is a weak pointer to the character. That means it doesn’t hold on to the character in memory. Meaning that if all other pointers are gone except this one, the character will still be deleted from memory. If we were using a regular pointer, it would be kept in memory until this last pointer to the character was removed too.

To get the pointer from a TWeakObjectPtr is done through .Get() like so: ASCharacter MyPawn = PawnInstigator.Get()* This returns the pointer IF it still exists, so make sure you check for nullptr after (if (PawnInstigator != nullptr) { }) before using it.

Hope that helps.