C++: Set the Child Actor

Hi, I just wanted to know hot to set the child actor in c++.


I want to be able to switch the weapon. My character has an ChildActor component and this will be the weapon. Each weapon is an Actor and with a function you should be able to change the cildActor to another weapon. So how am I able to achieve this?


link text I found this when I googeled this, but ChildActor->ChildActorClass is a private function.


link text Even this solution didn’t work, because ChildActor->SetChildActorClass somhow it can’t access this function.


link text At last I found this, but I have no Idea how to use this or if it is even related to my issue.

You really don’t need the child actor component here.
Just attach the weapon to your character (if it should be attached) and safe the weapon’s pointer in a variable.