# AddForce/AddImpulse won't work

**URL:** <https://forums.unrealengine.com/t/addforce-addimpulse-wont-work/329905>\
**Category:** World Creation\
**Tags:** addforce, unreal-engine, Physics, question, CPP\
**Created:** [August 25, 2015, 9:23pm UTC](https://forums.unrealengine.com/t/addforce-addimpulse-wont-work/329905 "2015-08-25T21:23:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_32da8d26](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_32da8d26](https://forums.unrealengine.com/u/anonymous_user_32da8d26)\
**Post date:** [August 25, 2015, 9:23pm UTC](https://forums.unrealengine.com/t/addforce-addimpulse-wont-work/329905/1 "2015-08-25T21:23:38Z")

</div>

Hey everyone,

I’ve created a Pawn class in C++, added a Mesh component and set physics simulation to true, as well as defining a physics profile to the Mesh (When I skipped this part, gravity wasn’t affecting the object). I used “Pawn”.

Now, I’m trying to AddForce on the Tick function, but don’t matter how big I make the force vector, the mesh simply won’t move.

The object is falling when I hit play, which means physics are being simulated, but Force/Impulse doesn’t get applied. I tried this both with Blueprints and C++.

When I use SetLinearVelocity, it works, but then gravity doesn’t affect the object.

I’m having a lot of issues with Physics with Unreal. Hope someone can help me out with this.

Here is my constructor code:

```
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
// Setting the skeletal mesh to be the root.
mesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Skeletal Mesh"));
RootComponent = mesh;
mesh->SetSimulatePhysics(true);
mesh->SetCollisionProfileName(TEXT("Pawn"));

```

And here’s the Tick function:

```
Super::Tick( DeltaTime );
mesh->AddForce(mesh->GetRightVector() * 10000);

```

Pretty basic stuff which should be working fine, I think.

Well, if someone can give me a hand with this, I’d really appreciate.

Thanks!

---

<div class="post-metadata">

**Author:** ![Mhousse1247](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mhousse1247](https://forums.unrealengine.com/u/Mhousse1247)\
**Post date:** [August 25, 2015, 9:46pm UTC](https://forums.unrealengine.com/t/addforce-addimpulse-wont-work/329905/2 "2015-08-25T21:46:51Z")

</div>

Try This

```
mesh->AddForce(FVector::RightVector * mesh->GetBodyInstance()->GetBodyMass() * 1000);
```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_32da8d26](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_32da8d26](https://forums.unrealengine.com/u/anonymous_user_32da8d26)\
**Post date:** [August 25, 2015, 9:56pm UTC](https://forums.unrealengine.com/t/addforce-addimpulse-wont-work/329905/3 "2015-08-25T21:56:25Z")

</div>

Thanks, , it worked! now I’m trying to understand why. If I don’t multiply by the mass, it assumes it’s 0 and makes the whole thing a zero vector? Or the mass then makes the vector something that’s big enough in size?

---

<div class="post-metadata">

**Author:** ![Mhousse1247](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mhousse1247](https://forums.unrealengine.com/u/Mhousse1247)\
**Post date:** [August 25, 2015, 10:01pm UTC](https://forums.unrealengine.com/t/addforce-addimpulse-wont-work/329905/4 "2015-08-25T22:01:07Z")

</div>

myabe “mesh-\>GetRightVector()” is facing the ground

There is an other way to ignore the mass by enabling “Acceleration”

mesh-\>AddForce(FVector::RightVector \* 1000,NAME\_None, true);

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_99ad6a471](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_99ad6a471](https://forums.unrealengine.com/u/anonymous_user_99ad6a471)\
**Post date:** [March 9, 2017, 3:05am UTC](https://forums.unrealengine.com/t/addforce-addimpulse-wont-work/329905/5 "2017-03-09T03:05:55Z")

</div>

Hi Thomas, I have a similar problem, I want to set velocity to my character, I have tried Mesh-\>SetLinearVelocity() and Mesh-\>AddForce(), I have followed your code, but still no motion, do you know why?
