This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
So I am very new to C , and I am still learning my way around its various flavors of obtuseness. I have a C class that I added a simple static mesh component to, then set up like so.
BulletMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Player Mesh"));
static ConstructorHelpers::FObjectFinder<UStaticMesh> BulletVisAsset(TEXT("/Engine/BasicShapes/Cylinder.Cylinder"));
if (BulletVisAsset.Succeeded()) { BulletMesh->SetStaticMesh(BulletVisAsset.Object); BulletMesh->Mobility = EComponentMobility::Movable; BulletMesh->AttachToComponent(GetRootComponent(), FAttachmentTransformRules::SnapToTargetIncludingScale); }
This code works just fine, however, that last line, the
BulletMesh->AttachToComponent(GetRootComponent(), FAttachmentTransformRules::SnapToTargetIncludingScale);
one, triggers a breakpoint every time I try to debug my code, which forces me to manually resume the compilation process, which gets kind of annoying.
The breakpoint looks like this:
A breakpoint instruction (_debugbreak() statement or a similar call) was executed in UnrealEditor-Win64-DebugGame.exe.
Any ideas as to what could be causing this and/or how to make it stop?
EDIT: SOLVED
In constructors when setting up attachment, you should useÂ
Comp->SetupAttachment(ParentComp)
 instead.
Subreddit
Post Details
- Posted
- 6 months ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/unrealengin...