RealDocs

AActor::GetCanBeDamagedPropertyName

function Engine Since 4.0
#include "GameFramework/Actor.h"
Access: public Specifiers: static

Description

Returns the FName of the `bCanBeDamaged` UPROPERTY, allowing subsystems to reference the property by name without hard-coding the string.

Caveats & Gotchas

  • This is an engine-internal accessor intended for use by replication, serialization, and editor tooling. Most gameplay code should use `CanBeDamaged()` and `SetCanBeDamaged()` instead.
  • Uses `GET_MEMBER_NAME_CHECKED` under the hood, which will generate a compile error if the underlying member is ever renamed — this is by design to prevent stale string references.

Signature

static const FName GetCanBeDamagedPropertyName()

Return Type

const FName

Example

Look up the property via reflection C++
FProperty* Prop = AActor::StaticClass()->FindPropertyByName(
    AActor::GetCanBeDamagedPropertyName()
);
check(Prop != nullptr);

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.