How do you set the Navigation Area Class for a Box Collision component in C++?
I’ve added the component to my class using the following.
Box = CreateDefaultSubobject<UBoxComponent>(TEXT("Box"));
When I create a Blueprint of my C++ class, the Box component has a section called Navigation in the Details panel. This section has a property called Area Class that is set to NavArea_Obstacle by default. I would like the default value to just be None. I know I can set it on the Blueprint, but I would rather set it in the C++ class constructor so I don’t have to remember to do it later when creating Blueprints from it.
I have found this on the Box component.
Which is this in the ShapeComponent.h header.
/** Navigation area type (empty = default obstacle) */ UPROPERTY(EditAnywhere, Category = Navigation) TSubclassOf<class UNavArea> AreaClass;
So this appears to be what I want. I just don’t know how to set it to None (which is one of the options in the Blueprint dropdown list).