Hi,
i am trying to create a child actor component, attach it to a parent component and execute functions inside this child actor component. Unfortunately i cannot get this to work for a child actor component, only for a new actor blueprint.
What i dont understand is how to access the child actor component once it is spawned. i add a Child Actor Component, set its class, and then try to cast to it, but this cast failes. I assume this is not the correct way to handle child actors, but i am not sure how else to do it.
Normally, if a child actor component is already a component when the game starts, you can access its variables and functions by first getting a reference to the component, then going through the Child Actor node and then cast to the blueprint class the child actor is using, but this does not seem to work when the child actor component is added after the game started, or i am using the wrong nodes for this.
How can i correctly spawn a child actor component and access its content after spawning it?
@Supremative this does work, but it would be suboptimal for my edge case, because i already am in a child actor component, any my code would spawn a new child actor component of the same class (being really careful about recursion of course) but in the details panel you cannot select the same child actor class you are already in.
i also now see why the Set Child Actor Class node did not work for me, same restriction here, if you set the class to the same class you are already working in, it just resets the class to blank and the cast after it will always fail. this seems to be a (somewhat reasonable) limitation by blueprints then and i will try another approach, not trying to spawn the child actor components inside the same child actor component class.