When i add a component to a actor in blueprint. And i use this blueprint class as actor class for a child actor component, the component is missing from the template actor of the child actor component.
Components added in C++ constructor work fine, components added in blueprint defaults are not existing in template.
Hello.
Yes it won’t pop up and it shouldn’t. The system is created to let you add SceneComponent
s to the children. If you want a component on a ChildActorComponent
or any child component, that component you’re trying to attach to your child component must be a SceneComponent
. You can’t add ActorComponent
s to children. You can only attach those to the main actors themselves. That approach doesn’t work for you to create an Actor
class and attach some components to it and then use it as a ChildActorComponent
.
Hello. Yes it won’t pop up and it shouldn’t. The system is created to let you add SceneComponents to the children. If you want a component on a ChildActorComponent or any child component, that component you’re trying to attach to your child component must be a SceneComponent. You can’t add ActorComponents to children. You can only attach those to the main actors themselves. That approach doesn’t work for you to create an Actor class and attach some components to it and then use it as a ChildActorComponent.
Hello! Just check that and everything is fine. Can you share steps to reproduce this?
1.) create a new project
2.) create a blueprint of an actor, named Child actor in this example
3.) open the blueprint and add components, for example scene components
4.) create a blueprint of an actor again, named Parent actor in this example
5.) open the blueprint and add a Child Actor Component
6.) set the child actor class of the child actor component to the child actor blueprint created in step 2
7.) take a look at the template property of the child actor component and notice that the components added in the blueprint are missing
If you make the child blueprint of any c++ class with components, like ACharacter, the inherited components of ACharacter are in the template property and can be edited. However everything added in the blueprint is still missing.
Yeah, just checked that. Indeed BP properties are not shown, maybe filtered by some property flags…
I don’t get what you mean? The whole purpose of the child actor component is to be able to attach a actor to a component inside another actor. Of course the child actor can have any number and kind of components. And that works just fine. Only components added via BP are not existing in the template, they do exist in the actor instance spawned to attach to the parent.
Maybe it makes more sense why this is important to me when i explain why i need to access them in the template. I want to have a preview of a actor inside of a character blueprint, so find the right transform to attach it on equip. I use a scene component on the weapon actor like a socket. So the weapon is not just attached by it’s pivot but has an additional transform from the scene component. I do not use a mesh socket here because weapons can be modular. It’s basically a socket to socket attach system. Which by the way works fine in game.
But in the BP editor i use the child actor component to attach a preview of the weapon and in editor ChildActor property is always nullptr. However template is valid and i can get all components from the template and get the transform of my “socket” scene component. But only if i added it in the C++ constructor. If i add it in it’s BP, it’s not existing in the template, not just hidden, it’s not part of the component list, will not show up if i iterate it.