Hi,
i want to all Actors in a Box Collision i have set up. But i can’t get it to work.
First is My World Object Collision (Actor which i want to destroy)
Second Picture is the Picture of my Blueprint
Third Picture is the Collision of my Trigger i have set up.
If you are wondering why there is OnBeginOverlap Destroy Volume: that is the Trigger i step on to activate the other trigger called ActorCollisionDetect.
Everything within ActorCollisionDetect should be destroyed.
try setting both volumes to overlap all. also your going to want to cast to your player characters class so that is the only thing that can trigger the event. you can do that using a cast to (insert character bp name here) node.
I tried printing out and actually get most of these objects printed out, not all. some are ignored for some reason. Any idea why? The event get definitely triggered
i assume you mean you added a print string after the for each loop. first did you try the suggestion i posted before? next what items are being destroyed and which ones are not? if you set the collision to overlap all then whatever is within the “actor collision detect” volume should get destroyed.
But i have one other question. I have a muzzle location at where my projectile spawns at my gun. But it gets affected by Animation. That means if i fire my gut my character pulls up and so do the bullets then. Is there a way i can get rid of this?
FP_MuzzleLocation = CreateDefaultSubobject<USceneComponent>(TEXT("MuzzleLocation"));
FP_MuzzleLocation->SetupAttachment(FP_Gun);
const FRotator SpawnRotation = FP_MuzzleLocation->GetComponentRotation();
const FVector SpawnLocation = FP_MuzzleLocation->GetComponentLocation();
UWorld* const World = GetWorld();
if (World != NULL)
{
// spawn the projectile at the muzzle
World->SpawnActor<AProjectile>(ProjectileClass, SpawnLocation, SpawnRotation);
}
i dont know much in the way of c++ so i cant really help there but i imagine you could play around with the parenting within the weapon bp so that the weapon moves but have the root say in one place