The comment describing UClass::HasProperty() indicates that it checks to see if a specified property exists in a class, or a parent of that class. However, when a property that exists in a child of that class is passed in, HasProperty() still returns true.
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = TestCat) USceneComponent* MyComp;
MyComp = CreateDefaultSubobject<USceneComponent>(TEXT("MyComp")); UProperty* prop = this->StaticClass()->FindPropertyByName("MyComp"); if (prop) { bool bResult = AActor::StaticClass()->HasProperty(prop); if (GEngine) { if (bResult) { GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::MakeRandomColor(), TEXT("AActor has MyComp.")); } else { GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::MakeRandomColor(), TEXT("AActor does not have MyComp.")); } } }
RESULT:
A message is displayed on the screen indicating that AActor contains MyComp.
EXPECTED:
A message is displayed on the screen indicating that AActor does not contain MyComp.
I am not able to find world outliner how to enable it?
How can i modify the param name in EQS node
Undefined sysmbol: typeinfo for AActor when cross-compile linux dedicated server on windows
How to achieve HLSL Multiple Render Target in Material blueprints?
How to properly terminate the DoWork thread function in FAsyncTask?
What method is used to fill polygonal regions when drawing spline mesh at run time?
How does UMG set overlapping layouts?
How to implement the left mouse button operation umg listview scroll bar?
When I open UE4 4.24.3 it appears that. Does anyone know how to solve?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-67859 in the post.
1 |
Component | UE - Foundation - Core |
---|---|
Affects Versions | 4.21.1, 4.22, 4.20.3 |
Target Fix | 4.22 |
Created | Dec 21, 2018 |
---|---|
Resolved | Jan 8, 2019 |
Updated | Feb 12, 2019 |