Difference between add child actor component and spawn actor from class

Good day I’m a newbie here. I’m trying to identify the difference between the two bacause it does the same (spawns things to the world). Is there an advantage of each or such features that the other doesn’t have when spawning things? Thanks!

So the difference there is that child actor needs to have “parent”. And parent is able to control it because it always has reference to it.

On the other hand, if you spawn regular actor (not child), you don’t have reference to it in your blueprint (or C++ code), so you need to get it on another way in order to control it.

Thanks for the reply but, is there a difference between the function “add child actor component” and “spawn actor from class”? Those two put actors in game if it is called (see attached image).

Hey you might want to check some of these videos from Mathew Wadstein. He has a lot of videos explaining and giving examples how to use certain nodes.

https://www.youtube.com/watch?v=jthUuQ5AweY
  • Actor - a full actor with all the features we love and cherish
  • Actor Component - a piece of modular, reusable functionality that can be added to Actors
  • Child Actor Component - a specialised Component that Spawns and holds onto an entire Actor

Imagine that you need a complex Actor that will be made out of many different Actors. Like a car.

So you create a Car Actor, a Wheel Actor, an Engine Actor, a Fuel Tank Actor, a PassengerSeat Actor and so on, each element responsible for different functionality while the Car just holds them together.

Now you can give the Car actor Child Actor Components and each will automagically spawn an Engine actor, a Fuel Tank actor and so on.

In your example, you’re dynamically adding Child Actor Components to an actor (you’re actually adding it to the Level Blueprint which could make sense is some situations).

Perhaps the player upgraded their vehicle and can now have an extra Fuel Tank with Nitro Fuel or GIANT ROTATING SCYTHES in front, because why not ¯_(ツ)_/¯

1 Like

Great explanation, as always! :slight_smile:

Very enlightening andthanks for the info but I have a followup question… what is the difference between the two function? “add child actor component” and “spawn actor from class”. Both of it can spawn on the map.

278554-capture.png

I thought I answered it above in fine detail.

Spawn Actor From Class spawns an actor.

Add Child Actor Component creates a component that spawns an actor.

1 Like

Lmao, he literally answers your question, and your follow up question is the same question you’ve been asking again and again. The one he already answered. Facepalm.

1 Like