# Applying Torque in Local Space on a Physics-driven Pawn

**URL:** <https://forums.unrealengine.com/t/applying-torque-in-local-space-on-a-physics-driven-pawn/371578>\
**Category:** World Creation\
**Tags:** torque, world-space, unreal-engine, Physics, velocity, question\
**Created:** [September 25, 2016, 3:05pm UTC](https://forums.unrealengine.com/t/applying-torque-in-local-space-on-a-physics-driven-pawn/371578 "2016-09-25T15:05:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xaymar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xaymar](https://forums.unrealengine.com/u/Xaymar)\
**Post date:** [September 25, 2016, 3:05pm UTC](https://forums.unrealengine.com/t/applying-torque-in-local-space-on-a-physics-driven-pawn/371578/1 "2016-09-25T15:05:32Z")

</div>

I have a physics driven Pawn and I’m currently trying to add turning using ‘Add Torque’ and ‘Set Angular Velocity’. But it seems that these functions are world-space aligned, which is the opposite of what I want: I need this to be aligned to the mesh itself. Right now, Add Torque and any other rotation stuff in physics always works in world space, which is the opposite of what I need.

I asked the same thing here in the forum: [Applying local angular velocity in a Physics-driven Actor? - Blueprint - Unreal Engine Forums](https://forums.unrealengine.com/showthread.php?123979-Applying-local-angular-velocity-in-a-Physics-driven-Actor&p=599704#post599704)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_98d3cf6b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_98d3cf6b](https://forums.unrealengine.com/u/anonymous_user_98d3cf6b)\
**Post date:** [October 5, 2016, 1:52pm UTC](https://forums.unrealengine.com/t/applying-torque-in-local-space-on-a-physics-driven-pawn/371578/2 "2016-10-05T13:52:49Z")

</div>

Hi Xaymar,

Here’s the solution that I found for this issue

This will add body-space aligned torque to your object

in cpp (From Actor Component C++ )

```
AActor *cubeActor = GetOwner();
FQuat myActorQuat = cubeActor->GetActorQuat();

TArray<UStaticMeshComponent*> Components;
cubeActor->GetComponents<UStaticMeshComponent>(Components);

	UStaticMeshComponent* StaticMeshComponent = Components[0];
	UStaticMesh* StaticMesh = StaticMeshComponent->StaticMesh;		
	GEngine->AddOnScreenDebugMessage(-1, 15, FColor::Green, StaticMesh->GetName());

	StaticMeshComponent->AddTorque(myActorQuat.RotateVector(FVector(100.0f, 0.0f, 0.0f)), NAME_None, true);

```

if you use Blueprints try this out

 ![109749-solution.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/c/d/acd14cef4831c64e3e02beef089dffbc36f8574a.png)

---

<div class="post-metadata">

**Author:** ![Xaymar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xaymar](https://forums.unrealengine.com/u/Xaymar)\
**Post date:** [October 11, 2016, 10:48am UTC](https://forums.unrealengine.com/t/applying-torque-in-local-space-on-a-physics-driven-pawn/371578/3 "2016-10-11T10:48:31Z")

</div>

Thank you, I went with your approach since it was easier than the blueprint only approach given on reddit. I might stay in C++ for the entire project now, since even simple things are horribly complicated in blueprint ☹

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0500cf20](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0500cf20](https://forums.unrealengine.com/u/anonymous_user_0500cf20)\
**Post date:** [November 17, 2016, 5:22am UTC](https://forums.unrealengine.com/t/applying-torque-in-local-space-on-a-physics-driven-pawn/371578/4 "2016-11-17T05:22:45Z")

</div>

Another potential solution:

I realized I had “use controller pitch / yaw / roll” set to “true” in the details section of my physics-driven pawn. Unchecking those options finally let my pawn rotate freely using AddTorque.

(This was after trying converting the coordinate space on my torque vectors between world and local without any luck.)

![115234-rotationcontrols.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/b/7/7b77f304c7681da32e8e7071310cb960d25317df.png)

---

<div class="post-metadata">

**Author:** ![Podgyhodgy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Podgyhodgy](https://forums.unrealengine.com/u/Podgyhodgy)\
**Post date:** [May 3, 2017, 5:18pm UTC](https://forums.unrealengine.com/t/applying-torque-in-local-space-on-a-physics-driven-pawn/371578/5 "2017-05-03T17:18:54Z")

</div>

I have given a blueprint example here that might help you.

[blueprint torque in local space](https://answers.unrealengine.com/questions/25535/add-torque-in-local-space.html#answer-596149)

---

<div class="post-metadata">

**Author:** ![Podgyhodgy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Podgyhodgy](https://forums.unrealengine.com/u/Podgyhodgy)\
**Post date:** [May 3, 2017, 5:20pm UTC](https://forums.unrealengine.com/t/applying-torque-in-local-space-on-a-physics-driven-pawn/371578/6 "2017-05-03T17:20:13Z")

</div>

I have given a blueprint example here that might help you.

[blueprint torque in local space](https://answers.unrealengine.com/questions/25535/add-torque-in-local-space.html#answer-596149)

---

<div class="post-metadata">

**Author:** ![lucien70](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lucien70](https://forums.unrealengine.com/u/lucien70)\
**Post date:** [May 18, 2017, 6:22pm UTC](https://forums.unrealengine.com/t/applying-torque-in-local-space-on-a-physics-driven-pawn/371578/7 "2017-05-18T18:22:54Z")

</div>

thank you very much for your help.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_ea7f2fa2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ea7f2fa2](https://forums.unrealengine.com/u/anonymous_user_ea7f2fa2)\
**Post date:** [May 13, 2019, 1:36pm UTC](https://forums.unrealengine.com/t/applying-torque-in-local-space-on-a-physics-driven-pawn/371578/8 "2019-05-13T13:36:28Z")

</div>

Thx Man your a GOD !
