Why we need to use createDefaultSubobject?

hey guys, basically i dont know why we need to use createDefaultSubobject. why it is necessary when we can use " UCLASS(meta = (BlueprintSpawnableComponent)) " and simply add the c++ class to blueprint? if we use createDefaultSubobject we will need to use BlueprintReadOnly.
its one step more so why bothering ourselves?
thank u.

There are almost always multiple ways to accomplish a goal. In this case, the point of using “CreateDefaultSubobject” might be to make the resulting blueprint less vulnerable to mistakes. For example, you might have a shop where C++ programmers provide a lot of the more complex framework for hte game, but another set of blueprint-only developers might be building up the game itself primarily in blueprint. This way, the blueprint devs can’t break the game framework by accidentally deleting a blueprint component.

I think.

thanks for answering. it was helpful

Privacy & Terms