So i have decided to use coding more and i have a question regarding EObjectTypeQuery
In CapsuleTraceSingleForObjects there is
TArray > & ObjectTypes
so i have figured out that TEnumAsByte is some dark magic that should be used for enums in unreal engine (altough a word of explanation here would be nice :>)
But i am completly clueless about the EObjectTypeQuery because the documentation page explains preety much nothing
TEnumAsByte is simply the variable type you use when declaring a variable that holds a reference to an enum value, e.g. suppose you’ve declared your enum as follows:
The 32 ObjectTypeQueries actually correspond to the options in the drop down list in the editor.
I discovered this by trial and error.
For Example, calling the following for a URadialForceComponent:
RemoveObjectTypeToAffect(EObjectTypeQuery::ObjectTypeQuery4);
would remove Physics Body.
RemoveObjectTypeToAffect(EObjectTypeQuery::ObjectTypeQuery5);
would remove Vehicle.
it’s bewildering that there’s no macros for this… are we missing something here?
Oh, it’s because it’s KismetSystemLibrary and intended only for blueprints. In code it actually converts these into collision channels and uses World->SweepMultiByObjectType(OutHits, Start, End, FQuat::Identity, ObjectParams, FCollisionShape::MakeSphere(Radius), Params)