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"

IgnoredActors are ignored in ActorLineTraceSingle method call

I am on UE4.5 and following is my scenario.

  • I have an Actor(A1) with a collision component and custom collision profile.

  • A1 fires another actor (A2) with a collision component and custom collision profile.

  • A2 starts moving towards an object (thin Wire (W)) of type WorldStatic. Here is the problem, since A2 moves quite fast, sometime it skips the collision with W and pass through it. In order to avoid this tunnelling problem I was trying to use ray tracing by calling ActorLineSingleTrace on A2. The call seems to be working but it hits either A1 or A2 which is not the desired result. In the meantime I have the overlap behaviour setup for A2 and W and it works only 50% of the time.

I added A1 and A2 to IgnoredActors list inside FCollisionQueryParams but if I debug deep in ActorLineTraceSingle I see that IgnoredActors parameter is not used at all. Am I missing something?

Any help is appreciated!!

Here is my code:

     FHitResult hitResult;
     GetWorld()->DebugDrawTraceTag = "BulletTrace";
     FCollisionQueryParams collisionParams;
     TArray<AActor*> ignoredActors;
     AActor* source = const_cast<AActor*>(Cast<AActor>(GetSource()));
     ignoredActors.Add(source);
     ignoredActors.Add(this);
     collisionParams.AddIgnoredActors(ignoredActors);
     collisionParams.TraceTag = "BulletTrace";
     if(ActorLineTraceSingle(hitResult, currentLocation, futureLocation, ECC_WorldStatic, collisionParams))
     {
         //Take appropriate action
     }












Product Version: Not Selected
Tags:
more ▼

asked Nov 23 '14 at 07:04 PM in C++ Programming

avatar image

Anshul
153 9 12 216

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

1 answer: sort voted first

I kept digging into this and found a solution :)

Instead of using ActorLineTraceSingle I am using GetWorld()->LineTraceSingle() which actually does respect the IgnoredActors list passed to the FCollisionQueryParams.

I also setup a new trace channel for this purpose.

more ▼

answered Nov 25 '14 at 01:41 AM

avatar image

Anshul
153 9 12 216

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
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