filmov
tv
How to find and use components generically in Unreal C++ - FindComponentByClass - UE C++ Tutorial

Показать описание
Actor components allow you to build modular gameplay features that can be mix and matched.
Often it is better to add a component, than create a new subclass of an actor.
It is easy to get an arbitrary component from an actor, even if it is added in blueprint.
There is the FindComponentByClass function, which allows you to iterate over the owned components to find one of the type you are searching for.
There is also the GetComponents function, which returns all the components of a given type in an array.
That is useful when there may be multiple components on a actor, such as with skeletal meshes.
0:00 What's an actor component?
0:14 Making a fake health system component
0:27 Adding code components to a blueprint actor
0:46 Using a console command to test acquiring a component
1:14 FindComponentByClass explored
1:35 Debugging FindComponentByClass via a console command test
1:53 Why you should prefer components
2:10 Looking at how FindComponentByClass works
2:25 How the ability system gives an alterantive to FindComponentByClass, AbilitySystemInterface
3:10 GetComponents functions is the plural version, returns multiple components
3:17 TInlineComponentArray explained, it has preallocated elements on stack
3:40 Adding skeletal mesh components to actor
3:58 Testing GetComponents function
Often it is better to add a component, than create a new subclass of an actor.
It is easy to get an arbitrary component from an actor, even if it is added in blueprint.
There is the FindComponentByClass function, which allows you to iterate over the owned components to find one of the type you are searching for.
There is also the GetComponents function, which returns all the components of a given type in an array.
That is useful when there may be multiple components on a actor, such as with skeletal meshes.
0:00 What's an actor component?
0:14 Making a fake health system component
0:27 Adding code components to a blueprint actor
0:46 Using a console command to test acquiring a component
1:14 FindComponentByClass explored
1:35 Debugging FindComponentByClass via a console command test
1:53 Why you should prefer components
2:10 Looking at how FindComponentByClass works
2:25 How the ability system gives an alterantive to FindComponentByClass, AbilitySystemInterface
3:10 GetComponents functions is the plural version, returns multiple components
3:17 TInlineComponentArray explained, it has preallocated elements on stack
3:40 Adding skeletal mesh components to actor
3:58 Testing GetComponents function
Комментарии