Howto add StaticMesh to SceneComponent
USceneComponent apparently has no RootComponent. So I have no idea how to add a StaticMesh to it:
Or do I have to use a ChildActorComponent instead of a SceneComponent? I can't really figure out what the difference between the two is. Note that using a ChildActorComponent instead also crashes the editor the same way.
My original code apparently was good. I have no idea why it crashed before. Probably something else caused a crash at exactly that line. But the code should be good. It is safe to derive from USceneComponent and to use the this-keyword to attach stuff to it and there is no need to manually add a RootComponent.
answered Jan 18 '18 at 06:27 AM
Hey there, SceneComponent and ChildActorComponent are 2 completely different components. SceneComponent is just a simple component with a transform and it's used to organize other components into a group, to serve as a pivot, or just to be there as a placeholder. ChildActorComponent allows you to add the functionality of an actor into your blueprint, so it will spawn an instance of that actor and make it part of your blueprint. Regarding your issue, a Root Component can be any SceneComponent (or child classes of it) but you are using "this", "this" is a reference to the actor, not the RootComponent, so you need to do:
answered Jan 05 '18 at 10:34 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here