As @MagForceSeven noted you shouldn’t be comparing class names.
What you want to do is use either Game Play Tags or Actor Tags.
If possible you’ll want to go with the C++ implementation of the IGameplayTagAssetInterface
. This allows you to get tags without casting to the actor. Otherwise use Actor Tags which doesn’t require casting.
Check the last paragraph