Actor components are an easy way to implement common functionality that should be shared between Actors. Actor components aren't rendered, but can still perform actions such as subscribing to events, or communicating with other components of the Actor that they are inside.
Creating a custom Actor Component
How to do it...
- Create an ActorComponent named RandomMovementComponent using the Editor wizard:
- Add the following UPROPERTY to the class header in the public section:
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "RandomMovementComponent.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class CHAPTER_04_API URandomMovementComponent...