Child Actor casting causes duplicate child actors in Play or Simulate mode

If I cast a child actor component in an event graph or construction script it duplicates the child actor in Play or Simulate mode. The example below works to set the material to the first child actor, but then on Play it is duplicated and the copy has no material set.

Edit: To clarify the bug.

Hey Apoc,

Have you tried setting this Blueprint Mesh to the Tower with the 2 Material Slots? If I’m understanding that correctly. Are you grabbing the material slot information from this Blueprint you’re on or from models within your content browser?

Peace

Actually I have found out that the material is being applied properly. It seems that the problem stems from casting an object from a child actor component. If I cast one it automatically duplicates the amount I have in the blueprint. In the example above it created two towers, the one with the material set was hidden because it was underneath the duplicated tower with no material set.

I have a child actor which is of class Tower (it’s a blueprint). I’m casting the child actor component to Tower and then grabbing the static mesh component of the tower blueprint and setting both materials on that mesh.

I’ve debugged this whole thing. If you cast a child actor component to anything it creates a duplicate object. At least on my installation. I’m looking to confirm on other installations.

If you don’t mind me asking, just so I can understand the situation more.

You have a child actor with a Mesh. You’re grabbing that mesh and casting it as the Tower. From there applying the two different materials to the said mesh?

So that would mean the Tower Blueprint would have a mesh within it. That of which you’re calling and setting in the Child Actor Class.

Hi Apoc,

I wanted to check in and see if you were still having an issue or if you discovered the problem and have already fixed it. If you are still having trouble please let me know so we can assist you. Thank you and have a great day!

I decided to pick up C++ and I haven’t had a problem since. The bug may still be there though.

I will check into it. However since you are no longer experiencing the problem I will go ahead and mark this as answered for tracking purposes. If you come across another potential bug please feel free to make a new answerhub post or if it is related post it here. Thank you and have a great day!

Hi, i experience problem similar to this right now, Why is my Child Actor component causing a crash? - C++ - Epic Developer Community Forums

Am currently experiencing the same problem, using version 4.9.2

Performing a cast to on a Child Actor component creates a duplicate, weirdly, the duplicate doesn’t appear in the World Outliner at runtime.
(Seems to only be visible on client sessions)

Hi Wobbleyheadedbob,

This issue is from very early in the development in the engine and many changes have occurred since this time. As such, the error you are seeing may not be directly linked to this. Please make a new answerhub post detailing the specifics of the error you are seeing so we can better assist you with your specific concerns.

In the new post, please include what steps you are taking to reproduce this error and whether or not this occurs in a clean, blank project with no additional content or if it is limited to one project. I am closing this thread as outdated.