BlockAllDynamic collision is being generated without setting the collision to it
I am having this issue with my C++ pawn. I want to set up a collision layer "Hitbox" which I want my projectile to detect. My projectile uses a multi line trace and checks the hit results for this collision layer. It works the way I want it to when I have the static meshes of the pawn placed manually into the scene. However, when I have them generated in my pawn class, there seems to have been a BlockAllDynamic layer overriding these collision layers in the C++ class. This is very frustrating because I never access or use collision presets in my code in any way, and something seems to be changing it without my knowledge or consent. No means no, Unreal.
I simply create the static mesh default subobjects and want to check their collision layers. The reason I have separate collision layers in one pawn is because I use forces to leverage the physics of the main body mesh, and want the hitbox collisions to have no effect on the physics, only to be detected by the projectiles.
Projectile class (inside Tick):
... UKismetSystemLibrary::LineTraceMulti_NEW(this, Start, End, ETraceTypeQuery::TraceTypeQuery2, false, TArray (), EDrawDebugTrace::ForDuration, Hits, true, FLinearColor::Red, FLinearColor::Green, 5.f);
Pawn class (inside ctor):
... B_Hitbox = CreateDefaultSubobject(TEXT("Back Hitbox")); B_Hitbox->AttachToComponent(Chassis, FAttachmentTransformRules::KeepRelativeTransform, NAME_None); B_Hitbox->SetVisibility(false); ...
asked Jan 22 '17 at 11:36 AM in C++ Programming
Follow this question
Once you sign in you will be able to subscribe for any updates here