# Error 2084 Function already has a body

**URL:** <https://forums.unrealengine.com/t/error-2084-function-already-has-a-body/299594>\
**Category:** C++\
**Tags:** error, unreal-engine, crash, function, functions, question, CPP\
**Created:** [November 22, 2014, 6:35am UTC](https://forums.unrealengine.com/t/error-2084-function-already-has-a-body/299594 "2014-11-22T06:35:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeusAap\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NeusAap\_1](https://forums.unrealengine.com/u/NeusAap_1)\
**Post date:** [November 22, 2014, 6:35am UTC](https://forums.unrealengine.com/t/error-2084-function-already-has-a-body/299594/1 "2014-11-22T06:35:20Z")

</div>

Hello everyone!

I am having problems with a function in my projectile class. It says that my function already has a body, which I don’t really understand. Every class starts with this function right?:

```
AFPSProjectile::AFPSProjectile(const class FObjectInitializer& PCIP)
	: Super(PCIP)
{

}

```

I acctually do have a header file:

```
// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "GameFramework/Actor.h"
#include "FPSProjectile.generated.h"

/**
 * 
 */
UCLASS()
class FPSPROJECT_API AFPSProjectile : public AActor
{
	GENERATED_BODY()
public:
	UPROPERTY(VisibleDefaultsOnly, Category = Projectile)
	/**TSubobjectPtr<USphereComponent> CollisionComp; 4.5 method (Now deprecated) */
	USphereComponent* CollisionComp;
	
	/** Projectile movement component */
	UPROPERTY(VisibleAnywhere, Category = Movement)
	/**TSubobjectPtr<class UProjectileMovementComponent> ProjectileMovement; 4.5 method(Now deprecated) */
	UProjectileMovementComponent* ProjectileMovement;

	void InitVelocity(const FVector& ShootDirection);
};

```

I hope you can help me solve this problem, and explain me what I did wrong!

Thanks in advance,  
NeusAap

P.S I am using engine version 4.6 preview

---

<div class="post-metadata">

**Author:** ![GregBlast](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GregBlast](https://forums.unrealengine.com/u/GregBlast)\
**Post date:** [November 22, 2014, 1:36pm UTC](https://forums.unrealengine.com/t/error-2084-function-already-has-a-body/299594/2 "2014-11-22T13:36:38Z")

</div>

You need to reference the default constructor in the header file.

Put:

* * *

```
AFPSProjectile(const class FObjectInitializer& PCIP);

```

* * *

into **FPSProjectile.h**.

PS: btw I’d advise you to now rename **PCIP** to **ObjectInitializer** from now on as it seems to have become the name they use. It’s just a matter of organizing things so that when you read their code you can match it with yours more easily.

---

<div class="post-metadata">

**Author:** ![NeusAap\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NeusAap\_1](https://forums.unrealengine.com/u/NeusAap_1)\
**Post date:** [November 22, 2014, 1:49pm UTC](https://forums.unrealengine.com/t/error-2084-function-already-has-a-body/299594/3 "2014-11-22T13:49:47Z")

</div>

Wow Thanks GregBlast!

I am really dumb 😛

Thanks again!

---

<div class="post-metadata">

**Author:** ![GregBlast](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GregBlast](https://forums.unrealengine.com/u/GregBlast)\
**Post date:** [November 22, 2014, 2:17pm UTC](https://forums.unrealengine.com/t/error-2084-function-already-has-a-body/299594/4 "2014-11-22T14:17:05Z")

</div>

No you’re not. I had to figure it out too because you didn’t have to in previous versions. And the default constructor was added automatically to the cpp file. Which now no longer is it seems. In my projects in previous engine versions the default constructor is not referenced in the header and it compiles.

---

<div class="post-metadata">

**Author:** ![MrWpGg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MrWpGg](https://forums.unrealengine.com/u/MrWpGg)\
**Post date:** [August 21, 2021, 11:42am UTC](https://forums.unrealengine.com/t/error-2084-function-already-has-a-body/299594/5 "2021-08-21T11:42:50Z")

</div>

old “GENERATED\_UCLASS\_BODY” macro includes constructor definition, new “GENERATED\_BODY” macro doesn’t.
