Coming soon - Get a detailed view of why an account is flagged as spam!
view details

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.

1
Is there any way to get rid of these annoying breakpoints in my C++ code?
Post Flair (click to view more posts with a particular flair)
Post Body

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.

Author
Account Strength
100%
Account Age
6 years
Verified Email
Yes
Verified Flair
No
Total Karma
9,892
Link Karma
5,366
Comment Karma
4,452
Profile updated: 2 days ago
Posts updated: 5 days ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
6 months ago