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"

Destructible Components always effect nav mesh even when collision disabled

  1. Create a class that derives from DestructibleComponent and apply my suggested hotfix to the problem described at: https://answers.unrealengine.com/questions/354110/destructiblecomponent-does-not-respect-calls-to-up.html

  2. Place an instance of this component in a level, and ensure 'Can Affect Navigation' is true

  3. Ensure your project has dynamic navmesh rebuilding enabled

  4. Do 'show navigation' and ensure there is a nav mesh correctly setup

  5. Note that the area around the component is marked as not navigable

  6. Add some blueprint script that sets the collision for the component/actor to NoCollision

  7. Note that the area around the component is still marked as not navigable

Expected result: when collision is disabled, the area should be marked as navigable.

This appears to be due to the following function:

 bool UPrimitiveComponent::IsNavigationRelevant() const 
 { 
     if (!CanEverAffectNavigation())
     {
         return false;
     }
 
     if (HasCustomNavigableGeometry() >= EHasCustomNavigableGeometry::EvenIfNotCollidable)
     {
         return true;
     }
 
     const FCollisionResponseContainer& ResponseToChannels = GetCollisionResponseToChannels();
     return IsCollisionEnabled() &&
         (ResponseToChannels.GetResponse(ECC_Pawn) == ECR_Block || ResponseToChannels.GetResponse(ECC_Vehicle) == ECR_Block);
 }
 

In the constructor of DestructibleComponent, hasCustomNavigableGeometry is set:

     bHasCustomNavigableGeometry = EHasCustomNavigableGeometry::EvenIfNotCollidable;


This means that even if collision is disabled, the mesh will still be considered non-navigable. Is this intended?

I'm hesitant to change this flag as the comment for it is:

         // DoCustomNavigableGeometryExport() should be called even if the mesh is non-collidable and wouldn't normally affect the navmesh

This doesn't mention anything about it's behaviour regarding IsNavigationRelevant.

Thanks, Isaac inbetweengames

Product Version: UE 4.10
Tags:
more ▼

asked Jan 06 '16 at 07:42 PM in Bug Reports

avatar image

eyesiah
123 8 15 26

avatar image Doug E ♦♦ STAFF Jan 07 '16 at 06:00 PM

Hey eyesiah-

Can you explain exactly what code you added/changed? I'm unable to find OnActorEnableCollisionChanged() or SetCollisionEnabled() inside the PrimitiveComponent.cpp file. Please explain exactly how you applied the hotfix you mentioned to help me work through your reproduction steps.

Cheers

Doug Wilson

avatar image eyesiah Jan 07 '16 at 06:29 PM

Attached is the hotfix for the other issue.

 [link text][1]

And here's a hotfix I've created for this issue

 bool UDADestructibleComponent::IsNavigationRelevant() const
 {
     if (!CanEverAffectNavigation())
     {
         return false;
     }
 
     const FCollisionResponseContainer& ResponseToChannels = GetCollisionResponseToChannels();
     bool relevant = IsCollisionEnabled() &&
         (ResponseToChannels.GetResponse(ECC_Pawn) == ECR_Block || ResponseToChannels.GetResponse(ECC_Vehicle) == ECR_Block);
 
     return relevant;
 }
 
 ECollisionEnabled::Type UDADestructibleComponent::GetCollisionEnabled() const
 {
     if (GetOwner() && !GetOwner()->GetActorEnableCollision())
     {
         return ECollisionEnabled::NoCollision;
     }
 
     return Super::GetCollisionEnabled();
 }
 

[1]: /storage/temp/73320-hotfix.txt

hotfix.txt (1.7 kB)
avatar image Doug E ♦♦ STAFF Jan 11 '16 at 08:54 PM

Hey eyesiah-

I've added the code you posted to a class however I'm not sure what you mean in the second step by adding "an instance of the component to the level." Could you also explain how the blueprint mentioned in step 6 is setup? Is the blueprint based on Actor or something else? Are you adding the custom destructible class as a component to this blueprint (if so does that mean that the class is marked as Blueprintable)?

avatar image eyesiah Jan 27 '16 at 11:27 AM

Hi Doug, Really sorry about the delay here.

By "an instance of the component to the level.", I mean:

  1. Create a blueprint

  2. Add a component of the new type to the blueprint

  3. Add an actor of that blueprint type to the level

Yes, the component class is marked Blueprintable.

The script mentioned in step 6 is added to the level script. Create a new custom event with a name like "RunTest", and setup that event to toggle the collision on the actor and/or component. Then play in PIE, and use console command "ce RunTest" to run the script you set up.

avatar image Doug E ♦♦ STAFF Jan 19 '16 at 09:03 PM

Hey eyesiah-

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.

avatar image eyesiah Jan 19 '16 at 09:09 PM

Sorry Doug - this slipped my mind. I'll reply to your question above as soon as I'm able.

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

1 answer: sort voted first

Hey eyesiah-

I was able to reproduce the navigation issue and have entered a bug report (UE-26121) for investigation.

Cheers

Doug Wilson

more ▼

answered Jan 27 '16 at 10:06 PM

(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