Adding Component to Actor vs Adding it as a Variable? What is the difference?

I have an Actor. I want this Actor to get data from a “Fragment Speed” Object component that I’ve made. But I noticed that I can add this component to the Actor in 2 ways, I can either click the “Add” Button top left or create it as a variable. (The image displays both types)

What is the difference? The one I made as a variable gives me additional options such as being able to expose it on spawn while the one I “Added” to the actor does not. Why is that?

  • when you add a component via the dropdown, the actor BP will actually instantiate an object and place it in the computer memory. Its reference variable is created automatically so you can access the component.
  • when you manually add a variable of component type instead, you skip the instantiation step. There is no component, just a null reference variable that could refer to a component but currently does not.

Not really. Creating a variable is not the same as instantiating a component. It couldn’t be more different, actually.

Think of it as of an address of a component in the computer memory, or another name for it. A variable like that can be handy as you may want to create some components dynamically run-time:

Once the reference variable gets a value assigned (SET), it now points at the component we’ve just created.


Both variables are pretty much identical. One has a value assigned, the other one does not. To simplify it greatly:

  • create a string variable and type in some text
  • create a string variable and don’t enter any text

One variable has value, the other one does not.

2 Likes