Have been trying to get a pointer to a
UPhysicsHandleComponent from the owning Actor using:
UPhysicsHandleComponent* PhysicsHandler = GetOwner()->FindComponentByClass();
What is the real difference between using the
FindComponentByClass<>() function and
GetComponentByClass()? Can both be used in similar use cases? If not what are the use cases?
GetComponentByClass is actually just another alias for the untemplated FindComponentByClass.
If you look at Actor.cpp, you’ll find the following:
UActorComponent* AActor::GetComponentByClass(TSubclassOf<UActorComponent> ComponentClass) const
I have witnessed this a lot in the source code, is there a reason why they would do that?