C++ Question

First of all, I am not best in C++ so sorry if I am asking a stupid question, I am trying to override a function in PrimitiveComponent and in it there few static variables that are not declared in the PrimitiveComponent.h because of that I cannot call them from a child of PrimitiveComponent. Am I missing something and its possible to call them? Or I need to declare then in my .h to be able to access them, or there another reason for them to be static?

Ps: example of static varible in PrimitiveComponent “static int32 bAllowCachedOverlapsCVar = 1;”

bAllowCachecOverlapsCVar is console variable, you can see how its registered later:

static FAutoConsoleVariableRef CVarAllowCachedOverlaps(
	TEXT("p.AllowCachedOverlaps"), 
	bAllowCachedOverlapsCVar,
	TEXT("Primitive Component physics\n")
	TEXT("0: disable cached overlaps, 1: enable (default)"),
	ECVF_Default);

More info about flags

I hope it helps!

It did thanks! For that part at least… guess I didn’t gave the perfect example there are still few static functions and structs that I can’t access to such as ShouldIgnoreOverlapResult and FPredicateFilterCannotOverlap can you help with that too?

These structs and functions are not part of primitivecomponent (i think they are only used in cpp as helpers and nowhere else – but im not sure about this).

They are used in UPrimitiveComponent functions like UPrimitiveComponent::UpdateOverlapsImpl, so you can override it here by replacing structs. Be careful, and make sure you know what they are doing before overriding them :smiley:

Well, I have no clue what I am doing, so I guess I just throw stuff at a wall and hope something will stick :smiley: