Createdefaultsubobject example. By the way, passing objects around by pointers is *extremely *common in UE4 C++, to the point that it’s basically the way to do it. currently I have. Im pretty sure the problem is on this line because removing m_poTextureRenderTarget = CreateDefaultSubobject<UTextureRenderTarget2D>(TEXT("Test")); What's weird is it's not the object, if I switch the two around, the mesh component crashes then. 25. CreateDefaultSubobject (FName, bool) Description Create a component or subobject, allows creating a child class and returning the parent class. 4 - CreateDefaultSubobject inside a child component attached to an actor loses values in blueprint editor Ask Question Asked 5 years, 2 months ago Modified 5 years, 2 months ago Jan 7, 2019 · So the CreateDefaultSubobject function creates an object AND returns the address-of the object? Yes. Sep 26, 2022 · Can you provide more information, possibly a sample of the code you are trying to do. ActorComp = CreateDefaultSubobject<UMyActorComp>(TEXT("ActorComp")); Nov 10, 2023 · Learn how to create default subobjects in Unreal Engine using C++ code. How to use: NewObject < classToReturn > (parent, ComponentClassToSpawn*) Example: Jan 28, 2024 · 1. After creating an instance in both cases, I do only one thing - set the Mesh. igtlg uxi iziabud qxtqqobp cjyz oyp sjn jarhhtj eeqpw dkllz