TSharedPtr/TWeakPtr do not work with UObjects.
If you want to use smart pointer with UObject you need to use TWeakObjectPtr<>
TSharedPtr/TWeakPtr do not work with UObjects.
If you want to use smart pointer with UObject you need to use TWeakObjectPtr<>