# Actors

The basic gameplay elements, Actors and Objects

An Actor is any object that can be placed into a level, such as a Camera, static mesh, or player start location. Actors support 3D transformations such as translation, rotation, and scaling. They can be created (spawned) and destroyed through gameplay code (C++ or Blueprints).

In C++, `AActor` is the base class of all Actors.

Note that actors do not directly store Transform (Location, Rotation, and Scale) data; the Transform data of the Actor's Root Component, if one exists, is used instead.

## Creating Actors

Creating new instances of `AActor` classes is called spawning. This can be done using the generic `SpawnActor()` function or one of its specialized templated versions.

See Spawning and Destroying an Actor for detailed info on the various methods of creating instances of `AActor` classes for gameplay.

## Components

Actors can be thought of, in one sense, as containers that hold special types of Objects called Components. Different types of Components can be used to control how Actors move, how they are rendered, etc. The other main function of Actors is the replication of properties and function calls across the network during play.

Components are associated with their containing Actor when they are created.

A few of the key types of Components are:

- UActorComponent : This is the base Component. It can be included as part of an Actor. It can Tick if you want it to. ActorComponents are associated with a specific Actor, but do not exist at any specific place in the world. They are generally used for conceptual functionality, like AI or interpreting player input.

- USceneComponent : SceneComponents are ActorComponents that have transforms. A transform is a position in the world, defined by location, rotation, and scale. SceneComponents can be attached to each other in a hierarchical fashion. An Actor's location, rotation, and scale are taken from the SceneComponent that is at the root of the hierarchy.

- UPrimitiveComponent : PrimitiveComponents are SceneComponents that have a graphical representation of some kind (e.g. a mesh or a particle system). Many of the interesting physics and collision settings are here.

Actors support having a hierarchy of SceneComponents. Each Actor also has a `RootComponent` property that designates which Component acts as the root for the Actor. Actors themselves do not have transforms, and thus do not have locations, rotations, or scales. Instead, they rely on the transforms of their Components; more specifically, their root Component. If this Component is a SceneComponent, it provides the transformation information for the Actor. Otherwise, the Actor will have no transform. Other attached Components have a transform relative to the Component they are attached to.

An example Actor and hierarchy might look something like this:

GoldPickup Actor | Hierarchy
--- | ---

- Root - SceneComponent: Basic scene Component to set the Actor's base location in the world.

  - StaticMeshComponent: Mesh representing gold ore.

    - ParticleSystemComponent: Sparkling particle emitter attached to the gold ore.
    - AudioComponent: Looping metallic chiming audio emitter attached to the gold ore.
    - BoxComponent: Collision box to use as trigger for overlap event for picking up the gold.

## Ticking

Ticking refers to how Actors are updated in Unreal Engine. All Actors have the ability to be ticked each frame, or at a minimum, user-defined interval, allowing you to perform any update calculations or actions that are necessary.

Actors all have the ability to be ticked by default via the `Tick()` function.

ActorComponents also have the ability to be updated by default, though they use the `TickComponent()` function to do so. See the Updating section of the Components page for more information.

## Lifecycle

See the Actor Lifecycle documentation for more information on how an Actor is created and removed from the game.

## Replication

Replication is used to keep the Actors within the world in sync when dealing with networked multiplayer games. Property values and function calls can both be replicated, allowing for complete control over the state of the game on all clients.

## Destroying Actors

Actors are not generally garbage collected, as the World Object holds a list of Actor references. Actors can be explicitly destroyed by calling `Destroy()`. This removes them from the level and marks them as "pending kill", which means they will hang around until they are cleaned up on the next garbage collection.

- actors
- architecture
- programming

Ask questions and help your peers Developer Forums

Write your own tutorials or read those from others Learning Library

On this page

- Creating Actors
- Components
- Ticking
- Lifecycle
- Replication
- Destroying Actors

## Privacy Preference Center

### Your Privacy

When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer. More information

- ### Strictly Necessary Cookies

  Always Active
  Strictly Necessary Cookies

  These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.

  Cookies Details‎

- ### Performance Cookies

  Performance Cookies

  These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.

  Cookies Details‎

- ### Functional Cookies

  Functional Cookies

  These cookies enable the website to provide enhanced functionality and personalization. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.

  Cookies Details‎

Consent Leg.Interest
Select All Vendors
Select All Vendors
Select All Hosts

Select All

- REPLACE-WITH-DYANMIC-HOST-ID

  ### 33Across

  View Third Party Cookies
  - Name
    cookie name

- REPLACE-WITH-DYANMIC-VENDOR-ID

  ### 33Across

  3 Purposes

  View Privacy Notice

  ### 33Across

  3 Purposes

  View Privacy Notice
  REPLACE-WITH-DYANMIC-VENDOR-ID

  Consent Purposes

  Location Based Ads

  Consent Allowed

  Legitimate Interest Purposes

  Personalize

  Require Opt-Out

  Special Purposes

  Location Based Ads

  Features

  Location Based Ads

  Special Features

  Location Based Ads

Clear Filters

Information storage and access

By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and personalize content.Privacy Policy