How to check a pointer valid?

You should use a TWeakObjectPtr<ACharacter> to hold the weak character reference in your code.

Is it specifically designed for this sort of thing:

/***
 * 
 * FWeakObjectPtr is a weak pointer to a UObject. 
 * It can return nullptr later if the object is garbage collected.
 * It has no impact on if the object is garbage collected or not.
 * It can't be directly used across a network.
 *
 * Most often it is used when you explicitly do NOT want to prevent something from being garbage collected.
 **/