x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

bStartPenetrating always returns false

Hello, I would not bother to ask but I'm really stuck for now. I try to make some kind of bullet penetration and was thinking about how it would be the best. So I stumbled across bStartPenetrating and wanted to make so that a trace would start inside the wall and would end at the impact point and just fire another one with a starting point of 1unit deeper till bStartPenetrating doesn't return true anymore to get the depth of the wall. But bStartPenetrating ALWAYS returns true for me. Help me please :(

 void ABullet_762::OnHit(AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
 {    
     FCollisionQueryParams TraceParams(FName(TEXT("ShootTrace")), true, this);
     TraceParams.bTraceComplex = true;
     TraceParams.bTraceAsyncScene = true;
     TraceParams.bReturnPhysicalMaterial = true;
     TraceParams.bFindInitialOverlaps = true;
 
     FHitResult HitData(ForceInit);
 
     float distance = 1.f;
 
     GetWorld()->LineTraceSingle(HitData, Hit.ImpactPoint + (GetActorRotation().Vector() * 1.1f), Hit.ImpactPoint, ECC_WorldDynamic, TraceParams);
     
     if (!HitData.bStartPenetrating)
     {
         DrawDebugPoint(GetWorld(), HitData.TraceStart, 8.f, FColor::Red, false, 10.f);
         DrawDebugPoint(GetWorld(), HitData.TraceEnd, 8.f, FColor::Green, false, 10.f);
         GEngine->AddOnScreenDebugMessage(-1, 2, FColor::Green, "NOPE1");
     }
     else
     {
         GEngine->AddOnScreenDebugMessage(-1, 2, FColor::Green, "YAW!");
     }
 
     while (HitData.bStartPenetrating && distance < 2000.f)
     {
         distance++;
         GetWorld()->LineTraceSingle(HitData, Hit.ImpactPoint + (GetActorRotation().Vector() * distance), Hit.ImpactPoint, ECC_Pawn, TraceParams);
         GEngine->AddOnScreenDebugMessage(-1, 2, FColor::Green, FString::SanitizeFloat(distance));
     }
 }

Edit: I already tried ECC_Pawn and ECC_StaticWorld

Product Version: Not Selected
Tags:
more ▼

asked Feb 01 '15 at 04:15 PM in C++ Programming

avatar image

Santo
1 2 3 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question