Why this code spawns two actors?
Hello. I am following the tutorials and, in the "on your own" chapter, I am wanted to learn how to attach complete actors to actors. I have managed to attach an actor to actor by spawning the actor I wanted to attach and attach its root component to the actor to be attached on. But the problem is, when this process is finished, I get two actors which I spawned instead of one.
Here is the code:
I get the spawned actor attached to my actual actor, plus I get one another spawned actor which isn't attached to anything. I don't want this extra spawned actor. How can I prevent this? Is this a bug?
Make sure you also destroy the child when your actor is destroyed. When you drag a BP into the world, a preview object gets created, then deleted. The child remains, unattached to anything.
answered Apr 25 '16 at 12:38 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here