Attach weapon using C++

Apologies - regarding the Root component: This is only required if you want to programmatically create a relative offset for your mesh. In your case you could simply set RootComponent = Weapon after creating the subobject, and ignore the RootComponentDummy part of my comment.