# ReceivePointDamage c++ error

**URL:** <https://forums.unrealengine.com/t/receivepointdamage-c-error/431780>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [August 16, 2018, 6:54pm UTC](https://forums.unrealengine.com/t/receivepointdamage-c-error/431780 "2018-08-16T18:54:07Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kodiack](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kodiack](https://forums.unrealengine.com/u/Kodiack)\
**Post date:** [August 16, 2018, 6:54pm UTC](https://forums.unrealengine.com/t/receivepointdamage-c-error/431780/1 "2018-08-16T18:54:07Z")

</div>

I’ve been following Harrison McGuire’s tutorial on health bar and UI HUD in c++ and all has been going well except for one error that has come up:

LogCompile: Error: ReceivePointDamage: Override of UFUNCTION in parent class (Actor) cannot have a UFUNCTION() declaration above it; it will use the same parameters as the original declaration.

It seems to say that i’m trying to override the ufunction but i’m declaring it in my header file, if i comment out the ufunction declared above it will compile correctly but the ReceivePointDamage function does not trigger. I even copy and pasted the code that Harrison Provided in this github post but to no avail. Here’s the header code:

#pragma once

#include “CoreMinimal.h”  
#include “GameFramework/Character.h”  
#include “Components/TimelineComponent.h”  
#include “Components/BoxComponent.h”  
#include “HUDPlusPlusCharacter.generated.h”

class UInputComponent;

UCLASS(config=Game)  
class AHUDPlusPlusCharacter : public ACharacter  
{  
GENERATED\_BODY()

```
/** Pawn mesh: 1st person view (arms; seen only by self) */
UPROPERTY(VisibleDefaultsOnly, Category=Mesh)
class USkeletalMeshComponent* Mesh1P;

/** Gun mesh: 1st person view (seen only by self) */
UPROPERTY(VisibleDefaultsOnly, Category = Mesh)
class USkeletalMeshComponent* FP_Gun;

/** Location on gun mesh where projectiles should spawn. */
UPROPERTY(VisibleDefaultsOnly, Category = Mesh)
class USceneComponent* FP_MuzzleLocation;

/** Gun mesh: VR view (attached to the VR controller directly, no arm, just the actual gun) */
UPROPERTY(VisibleDefaultsOnly, Category = Mesh)
class USkeletalMeshComponent* VR_Gun;

/** Location on VR gun mesh where projectiles should spawn. */
UPROPERTY(VisibleDefaultsOnly, Category = Mesh)
class USceneComponent* VR_MuzzleLocation;

/** First person camera */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
class UCameraComponent* FirstPersonCameraComponent;

/** Motion controller (right hand) */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
class UMotionControllerComponent* R_MotionController;

/** Motion controller (left hand) */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
class UMotionControllerComponent* L_MotionController;

```

public:  
AUHUDPlusPlusCharacter();

protected:  
virtual void BeginPlay();

```
virtual void Tick(float DeltaTime) override;

// virtual float TakeDamage(float DamageAmount, struct FDamageEvent const & DamageEvent, class AController * EventInstigator, AActor * DamageCauser);

```

public:  
/\*\* Base turn rate, in deg/sec. Other scaling may affect final turn rate. \*/  
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)  
float BaseTurnRate;

```
/** Base look up/down rate, in deg/sec. Other scaling may affect final rate. */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
float BaseLookUpRate;

/** Gun muzzle's offset from the characters location */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Gameplay)
FVector GunOffset;

/** Projectile class to spawn */
UPROPERTY(EditDefaultsOnly, Category=Projectile)
TSubclassOf<class AHUDPlusPlusProjectile> ProjectileClass;

/** Sound to play each time we fire */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Gameplay)
class USoundBase* FireSound;

/** AnimMontage to play each time we fire */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Gameplay)
class UAnimMontage* FireAnimation;

/** Whether to use motion controller location for aiming. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Gameplay)
uint32 bUsingMotionControllers : 1;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Health")
float FullHealth;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Health")
float Health;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Health")
float HealthPercentage;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Health")
float FullMagic;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Magic")
float Magic;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Magic")
float MagicPercentage;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Magic")
float PreviousMagic;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Magic")
float MagicValue;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Health")
bool redFlash;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Magic")
UCurveFloat *MagicCurve;

UPROPERTY(EditAnywhere, Category = "Magic")
FTimeline MyTimeline;

UPROPERTY(EditAnywhere, Category = "Magic")
FTimerHandle MemberTimerHandle;

UPROPERTY(EditAnywhere, Category = "Magic")
FTimerHandle MagicTimerHandle;

float CurveFloatValue;
float TimelineValue;
bool bCanUseMagic;

/** Get Health */
UFUNCTION(BlueprintPure, Category = "Health")
float GetHealth();

/** Get Magic */
UFUNCTION(BlueprintPure, Category = "Magic")
float GetMagic();

/** Get Health Text */
UFUNCTION(BlueprintPure, Category = "Health")
FText GetHealthIntText();

/** Get Magic Text */
UFUNCTION(BlueprintPure, Category = "Magic")
FText GetMagicIntText();

/** Damage Timer */
UFUNCTION()
void DamageTimer();

/** Set Damage State */
UFUNCTION()
void SetDamageState();

/** Set Magic Value */
UFUNCTION()
void SetMagicValue();

/** Set Damage State */
UFUNCTION()
void SetMagicState();

/** Set Damage State */
UFUNCTION()
void SetMagicChange(float MagicChange);

/** Set Damage State */
UFUNCTION()
void UpdateMagic();

/** Play Flash */
UFUNCTION(BlueprintPure, Category = "Health")
bool PlayFlash();

UPROPERTY(EditAnywhere, Category = "Magic")
class UMaterialInterface* GunDefaultMaterial;

UPROPERTY(EditAnywhere, Category = "Magic")
class UMaterialInterface* GunOverheatMaterial;

UFUNCTION()
void ReceivePointDamage(float Damage, const UDamageType * DamageType, FVector HitLocation, FVector HitNormal, UPrimitiveComponent * HitComponent, FName BoneName, FVector ShotFromDirection, AController * InstigatedBy, AActor * DamageCauser, const FHitResult & HitInfo);

UFUNCTION(BlueprintCallable, Category = "Power")
void UpdateHealth(float HealthChange);

```

protected:

```
/** Fires a projectile. */
void OnFire();

/** Resets HMD orientation and position in VR. */
void OnResetVR();

/** Handles moving forward/backward */
void MoveForward(float Val);

/** Handles stafing movement, left and right */
void MoveRight(float Val);

/**
 * Called via input to turn at a given rate.
 * @param Rate	This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
 */
void TurnAtRate(float Rate);

/**
 * Called via input to turn look up/down at a given rate.
 * @param Rate	This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
 */
void LookUpAtRate(float Rate);

struct TouchData
{
	TouchData() { bIsPressed = false;Location=FVector::ZeroVector;}
	bool bIsPressed;
	ETouchIndex::Type FingerIndex;
	FVector Location;
	bool bMoved;
};
void BeginTouch(const ETouchIndex::Type FingerIndex, const FVector Location);
void EndTouch(const ETouchIndex::Type FingerIndex, const FVector Location);
void TouchUpdate(const ETouchIndex::Type FingerIndex, const FVector Location);
TouchData	TouchItem;

```

protected:  
// APawn interface  
virtual void SetupPlayerInputComponent(UInputComponent\* InputComponent) override;  
// End of APawn interface

```
/* 
 * Configures input for touchscreen devices if there is a valid touch interface for doing so 
 *
 * @param	InputComponent	The input component pointer to bind controls to
 * @returns true if touch controls were enabled.
 */
bool EnableTouchscreenMovement(UInputComponent* InputComponent);

```

public:  
/\*\* Returns Mesh1P subobject _/  
FORCEINLINE class USkeletalMeshComponent GetMesh1P() const { return Mesh1P; }  
/_\* Returns FirstPersonCameraComponent subobject \*_/  
FORCEINLINE class UCameraComponent_ GetFirstPersonCameraComponent() const { return FirstPersonCameraComponent; }

};

anyone have any ideas?

---

<div class="post-metadata">

**Author:** ![Aericks](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Aericks](https://forums.unrealengine.com/u/Aericks)\
**Post date:** [August 17, 2018, 12:28pm UTC](https://forums.unrealengine.com/t/receivepointdamage-c-error/431780/2 "2018-08-17T12:28:38Z")

</div>

I’m going to point out really quick that you have a lot of unnecessary code. This isn’t exactly bad, but someone popping in is not going to take the time to read it. Next time, I suggest that you make it as concise as possible by cutting out unnecessary bits.

I don’t have a solid answer for you but I found another answer here: [Cant override ReceivePointDamage - Documentation Feedback - Unreal Engine Forums](https://answers.unrealengine.com/questions/547614/cant-override-receivepointdamage.html)

Also, I found this tutorial here that uses what you are using. It may be of some help. [https://unrealcpp.com/health-bar-ui-hud/](https://unrealcpp.com/health-bar-ui-hud/)

good luck!!

---

<div class="post-metadata">

**Author:** ![Kodiack](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kodiack](https://forums.unrealengine.com/u/Kodiack)\
**Post date:** [August 17, 2018, 6:22pm UTC](https://forums.unrealengine.com/t/receivepointdamage-c-error/431780/3 "2018-08-17T18:22:55Z")

</div>

Thank you for replying Aericks. I understand your point about all the unnecessary code i did however  
post the error line seperately. the tutorial link you provided is actually the tutorial i have been following.  
I will try your suggestion of creating a different function and calling ReceivePointDamage from there.  
Though i still don’t understand why it thinks i’m trying to override the function instead of declaring it.

---

<div class="post-metadata">

**Author:** ![Kodiack](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kodiack](https://forums.unrealengine.com/u/Kodiack)\
**Post date:** [August 19, 2018, 8:06pm UTC](https://forums.unrealengine.com/t/receivepointdamage-c-error/431780/4 "2018-08-19T20:06:20Z")

</div>

![250968-receivepointdamage-error.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/3/5/f3583dcdf2aaa06012a1b75dea6c0f567c0c56e3.jpeg)

apologies for the late update i was doing some experimentation. i noticed after the error line there  
is another comment about the unrealheadertool failed for target. i looked up about this wondering if  
this in fact caused the error line above it. i removed all /\* comments and replaced them with //. but still the original error line shows up. I hope this additional info is useful and if anyone would like a zip file of  
this project to test out for themselves let me know

---

<div class="post-metadata">

**Author:** ![Kodiack](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kodiack](https://forums.unrealengine.com/u/Kodiack)\
**Post date:** [August 20, 2018, 1:51am UTC](https://forums.unrealengine.com/t/receivepointdamage-c-error/431780/5 "2018-08-20T01:51:50Z")

</div>

This is an engine error. it appears to be a 4.20 version problem. Pretty sure it will work in previous versions. will test this out.

---

<div class="post-metadata">

**Author:** ![dolboeb\_korova\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dolboeb\_korova\_1](https://forums.unrealengine.com/u/dolboeb_korova_1)\
**Post date:** [March 21, 2019, 7:17pm UTC](https://forums.unrealengine.com/t/receivepointdamage-c-error/431780/6 "2019-03-21T19:17:11Z")

</div>

I also keep getting this error, did you ever find a workaround for it?

---

<div class="post-metadata">

**Author:** ![Kodiack](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kodiack](https://forums.unrealengine.com/u/Kodiack)\
**Post date:** [March 21, 2019, 7:42pm UTC](https://forums.unrealengine.com/t/receivepointdamage-c-error/431780/7 "2019-03-21T19:42:00Z")

</div>

Hi Dolboeb, i did find a workaround for this. I used the TakeDamage function here’s the code:

(character.h)

virtual float TakeDamage(float DamageAmount, struct FDamageEvent const & DamageEvent, class AController \* EventInstigator, AActor \* DamageCauser);

(character.cpp)

float AHUDPlusPlusCharacter::TakeDamage(float DamageAmount, struct FDamageEvent const & DamageEvent, class AController \* EventInstigator, AActor \* DamageCauser)  
{  
bCanBeDamaged = false;  
redFlash = true;  
UpdateHealth(-DamageAmount);  
DamageTimer();  
return DamageAmount;  
}

---

<div class="post-metadata">

**Author:** ![ZhenZhongLuo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZhenZhongLuo](https://forums.unrealengine.com/u/ZhenZhongLuo)\
**Post date:** [April 23, 2019, 5:36am UTC](https://forums.unrealengine.com/t/receivepointdamage-c-error/431780/8 "2019-04-23T05:36:34Z")

</div>

Solution found. Here you go:

  
Also, you can read through ApplyPointDamage(). At the end, it’s calling the DamageActor-\>TakeDamage(), which all you need to do is to override TakeDamage() in your Actor.

---

<div class="post-metadata">

**Author:** ![Kodiack](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kodiack](https://forums.unrealengine.com/u/Kodiack)\
**Post date:** [April 23, 2019, 6:16pm UTC](https://forums.unrealengine.com/t/receivepointdamage-c-error/431780/9 "2019-04-23T18:16:08Z")

</div>

For those who can’t get ReceivePointDamage to work, Use TakeDamage. Here’s the Code

(character.h)

virtual float TakeDamage(float DamageAmount, struct FDamageEvent const & DamageEvent, class AController EventInstigator, AActor DamageCauser);

(character.cpp)

float AHUDPlusPlusCharacter::TakeDamage(float DamageAmount, struct FDamageEvent const & DamageEvent, class AController EventInstigator, AActor DamageCauser) { bCanBeDamaged = false; redFlash = true; UpdateHealth(-DamageAmount); DamageTimer(); return DamageAmount; }

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [May 28, 2023, 2:51pm UTC](https://forums.unrealengine.com/t/receivepointdamage-c-error/431780/10 "2023-05-28T14:51:17Z")

</div>

it is not a pure virtual funtion: (BlueprintImplementableEvent)

> | | /\*\* Event when this actor takes POINT damage \*/ |
> | --- | --- |
> | | UFUNCTION( **BlueprintImplementableEvent** , BlueprintAuthorityOnly, meta=(DisplayName = PointDamage), Category=Game |
> | | void **ReceivePointDamage** (float Damage, const class UDamageType\* DamageType, FVector HitLocation, FVector HitNormal, class UPrimitiveComponent\* HitComponent, FName BoneName, FVector ShotFromDirection, class AController\* InstigatedBy, AActor\* DamageCauser, const FHitResult& HitInfo); |

so… i think it must implemented like this:

> void MyClass::ReceivePointDamage(…)  
> {
> 
> }

below a more complete explanation:

> [@How to implement a virtual UFUNCTION?](https://forums.unrealengine.com/t/how-to-implement-a-virtual-ufunction/1152674/4):
>
> You have various options: BlueprintNativeEvent, this is a function that has a base implementation on C++ and can be overridden in blueprints, in C++ you define the “\_Implementation” one, you have to call the one that doesn’t end in “\_Implementation” in C++ UFUNCTION(BlueprintCallable, BlueprintNativeEvent) void RemoveNegativeAlteredStates(); void RemoveNegativeAlteredStates\_Implementation(); If it’s overridden in blueprints and you want to call the base functionality as well, you have to “a…
