# Class "USceneComponent" has no member "AddForce" or "AddImpulse" And "GetMass"

**URL:** <https://forums.unrealengine.com/t/class-uscenecomponent-has-no-member-addforce-or-addimpulse-and-getmass/469033>\
**Category:** C++\
**Tags:** addforce, unreal-engine, UE4, CPP, question, actor-class\
**Created:** [August 1, 2020, 9:25am UTC](https://forums.unrealengine.com/t/class-uscenecomponent-has-no-member-addforce-or-addimpulse-and-getmass/469033 "2020-08-01T09:25:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_dba308321](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_dba308321](https://forums.unrealengine.com/u/anonymous_user_dba308321)\
**Post date:** [August 1, 2020, 9:25am UTC](https://forums.unrealengine.com/t/class-uscenecomponent-has-no-member-addforce-or-addimpulse-and-getmass/469033/1 "2020-08-01T09:25:47Z")

</div>

in cpp

```
 void ANewActor_::BluprntFunction() {
    	Mesh_->AddForce((FVector::UpVector * 1000) * Mesh_->GetMass());
    	//Mesh_->AddImpulse(FVector(0, 0, 1000) * Mesh_->GetMass());
    	//Mesh_->AddForce
    }

```

in .h

```
public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

	UFUNCTION(BlueprintCallable)
		void BluprntFunction();

```

---

<div class="post-metadata">

**Author:** ![EvilCleric](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EvilCleric](https://forums.unrealengine.com/u/EvilCleric)\
**Post date:** [August 1, 2020, 10:11am UTC](https://forums.unrealengine.com/t/class-uscenecomponent-has-no-member-addforce-or-addimpulse-and-getmass/469033/2 "2020-08-01T10:11:16Z")

</div>

Don’t understand what the problem is? USceneComponent doesn’t have them, so … [https://docs.unrealengine.com/en-US/API/Runtime/Engine/Components/USceneComponent/index.html](https://docs.unrealengine.com/en-US/API/Runtime/Engine/Components/USceneComponent/index.html)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_003d23a7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_003d23a7](https://forums.unrealengine.com/u/anonymous_user_003d23a7)\
**Post date:** [August 1, 2020, 10:54am UTC](https://forums.unrealengine.com/t/class-uscenecomponent-has-no-member-addforce-or-addimpulse-and-getmass/469033/3 "2020-08-01T10:54:15Z")

</div>

You might want to use the UPrimitiveComponent, which derives from USceneComponent.

> **[UPrimitiveComponent](https://docs.unrealengine.com/5.2/en-US/API/Runtime/Engine/Components/UPrimitiveComponent/)**
>
> PrimitiveComponents are SceneComponents that contain or generate some sort of geometry, generally to be rendered or used as collision data.

---

<div class="post-metadata">

**Author:** ![EvilCleric](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EvilCleric](https://forums.unrealengine.com/u/EvilCleric)\
**Post date:** [August 1, 2020, 11:24am UTC](https://forums.unrealengine.com/t/class-uscenecomponent-has-no-member-addforce-or-addimpulse-and-getmass/469033/4 "2020-08-01T11:24:57Z")

</div>

Unless, of course, you’re trying to set those members for the Mesh\_ component. If that’s the case, then the error, is probably related with the lack of the proper header.

If static mesh:

```
#include "Components/StaticMeshComponent.h" 

```

If skeletal mesh:

```
#include "Components/SkeletalMeshComponent.h"
```

---

<div class="post-metadata">

**Author:** ![TheKaosSpectrum](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheKaosSpectrum](https://forums.unrealengine.com/u/TheKaosSpectrum)\
**Post date:** [August 1, 2020, 8:26pm UTC](https://forums.unrealengine.com/t/class-uscenecomponent-has-no-member-addforce-or-addimpulse-and-getmass/469033/5 "2020-08-01T20:26:31Z")

</div>

What is up with the bad naming? ANewActor\_ ? Mesh\_ ? I have never seen any coding style do that and it looks disgusting. That \_ is a useless and ■■■■ ugly extra char.
