March 2019
Intermediate to advanced
708 pages
17h 9m
English
First, we add a few specifiers to the UCLASS macro that was used in our component's declaration. Adding BlueprintSpawnableComponent to the class's meta values means that instances of the component can be added to Blueprint classes in the editor. The ClassGroup specifier allows us to indicate what category of class our Component belongs to in the list of classes:
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
Adding MovementRadius as a property to the new component allows us to specify how far the component will be allowed to wander in a single frame:
UPROPERTY() float MovementRadius;
In the constructor, we initialize this property to a safe default value:
MovementRadius = 5;
TickComponent is a function ...
Read now
Unlock full access