Hello all c++ programmer using unreal engine here. I’m having trouble with the set up attachment method.
I’ve taken the proper steps in using FObjectInitializer… now when I SetUpAttachment() Nothing at all what so ever " I’m trying to display a Uspherecomponent by the way. I did this 10 plus times before where the issue was to restart the editor what in the world is going on?
Hello,
It should be setup something like:
.h
USceneComponent *RootSceneComponent;
USphereComponent *MySphereComponent;
.cpp
AMyActor::AMyActor( )
{
RootSceneComponent = CreateDefaultSubobject<USceneComponent>(TEXT("Root"));
= RootSceneComponent;
MySphereComponent = CreateDefaultSubobject<USphereComponent>(TEXT("Sphere"));
MySphereComponent->SetupAttachment();
}
Thanks, i forgot a word in there I have it working now aka const…