# how To rotae a sub component  mesh bases on forward axis input  acceleration.

**URL:** <https://forums.unrealengine.com/t/how-to-rotae-a-sub-component-mesh-bases-on-forward-axis-input-acceleration/58522>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [March 17, 2016, 1:05pm UTC](https://forums.unrealengine.com/t/how-to-rotae-a-sub-component-mesh-bases-on-forward-axis-input-acceleration/58522 "2016-03-17T13:05:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![BaseReality](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/basereality/32/893179_2.png) [@BaseReality](https://forums.unrealengine.com/u/BaseReality)\
**Post date:** [March 17, 2016, 1:05pm UTC](https://forums.unrealengine.com/t/how-to-rotae-a-sub-component-mesh-bases-on-forward-axis-input-acceleration/58522/1 "2016-03-17T13:05:44Z")

</div>

Basically I have a flying vehicle based off the flying template.  
I have a Main hull mesh with a socket that I’ve attached a sub mesh too, and I want that sub mesh to rotate to a maximum of 90 degrees to the rear when acceleration is applied & 10 degrees facing forwards when reverse is applied, all based on an axis input.  
So the more acceleration I apply the more the sub mesh rotates to the maximum value of 90 degrees. facing backwards

Ps: the rotation needs to be local/central to the socket and stay connected to the ship, not rotate around the ship as these are engines thrusters.

Thanks.

---

<div class="post-metadata">

**Author:** ![BoredEngineer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BoredEngineer](https://forums.unrealengine.com/u/BoredEngineer)\
**Post date:** [March 17, 2016, 1:29pm UTC](https://forums.unrealengine.com/t/how-to-rotae-a-sub-component-mesh-bases-on-forward-axis-input-acceleration/58522/2 "2016-03-17T13:29:08Z")

</div>

AddRelativeRotation() node is what you need, apply it to sub-component itself.

---

<div class="post-metadata">

**Author:** ![BaseReality](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/basereality/32/893179_2.png) [@BaseReality](https://forums.unrealengine.com/u/BaseReality)\
**Post date:** [March 17, 2016, 1:49pm UTC](https://forums.unrealengine.com/t/how-to-rotae-a-sub-component-mesh-bases-on-forward-axis-input-acceleration/58522/3 "2016-03-17T13:49:52Z")

</div>

Thanks I will try that when I get back home. 🙂

---

<div class="post-metadata">

**Author:** ![BaseReality](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/basereality/32/893179_2.png) [@BaseReality](https://forums.unrealengine.com/u/BaseReality)\
**Post date:** [March 18, 2016, 4:51pm UTC](https://forums.unrealengine.com/t/how-to-rotae-a-sub-component-mesh-bases-on-forward-axis-input-acceleration/58522/4 "2016-03-18T16:51:04Z")

</div>

I did add AddRelativeRotation but had mixed results. at first it was spinning really fast and then I managed to get it to rotate to 90 degrees but it happend as soon as Applied forwards thrust input axis i setup. then it stayed stuck there :(.  
Nothing I managed to do caused it to move in relation to what I was doing with the left analog stick On the game pad im using.  
But ive seen this and am wondering if this in the answer

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

Eventually I want the Vtol thrusters ive attached to the Ship im flying to rotate as I apply more thrust on the HOTAS flight stick throttle Until at maximum thrust they are horizontal propelling the ship forwards.  
like in this image [http://www.tfw2005.com/boards/attachments/radicons-customs/27087680d1243227769-terminator-hunter-killer-100\_1404.jpg](http://www.tfw2005.com/boards/attachments/radicons-customs/27087680d1243227769-terminator-hunter-killer-100_1404.jpg)

---

<div class="post-metadata">

**Author:** ![BoredEngineer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BoredEngineer](https://forums.unrealengine.com/u/BoredEngineer)\
**Post date:** [March 18, 2016, 9:21pm UTC](https://forums.unrealengine.com/t/how-to-rotae-a-sub-component-mesh-bases-on-forward-axis-input-acceleration/58522/5 "2016-03-18T21:21:57Z")

</div>

Thank you for more detailed explanation on what you want to achieve. I do something very similar for steering of control surface on airplane:  
 ![367d0fb2d0fb25097baff69d921259d517f7fe27.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)

This function is called on Tick event.  
“Vertical Steering Axis Value” is your user input from -1 to 1  
“Max Elevator Steering Angle” will be 90 degrees in your case  
InterpSpeed in FInterp to Constant node is how fast rotation should happen

---

<div class="post-metadata">

**Author:** ![BaseReality](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/basereality/32/893179_2.png) [@BaseReality](https://forums.unrealengine.com/u/BaseReality)\
**Post date:** [March 21, 2016, 12:22pm UTC](https://forums.unrealengine.com/t/how-to-rotae-a-sub-component-mesh-bases-on-forward-axis-input-acceleration/58522/6 "2016-03-21T12:22:48Z")

</div>

Thanks for the picture, I got almost all of this done but cant figure out the node between (elevator) & (FInterp to Constant) is  
Im still a BP noob for the most part.

---

<div class="post-metadata">

**Author:** ![BoredEngineer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BoredEngineer](https://forums.unrealengine.com/u/BoredEngineer)\
**Post date:** [March 21, 2016, 12:42pm UTC](https://forums.unrealengine.com/t/how-to-rotae-a-sub-component-mesh-bases-on-forward-axis-input-acceleration/58522/7 "2016-03-21T12:42:28Z")

</div>

This is GetRelativeRotation node, it is simply collapsed into components, similar to “BrakeRotator” node. Just right click on output pin of GetRelativeRotation node, which should be a Rotator structure, if nothing is connected to it then you should see an option to split output.

---

<div class="post-metadata">

**Author:** ![BaseReality](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/basereality/32/893179_2.png) [@BaseReality](https://forums.unrealengine.com/u/BaseReality)\
**Post date:** [March 25, 2016, 8:09am UTC](https://forums.unrealengine.com/t/how-to-rotae-a-sub-component-mesh-bases-on-forward-axis-input-acceleration/58522/8 "2016-03-25T08:09:54Z")

</div>

Me again.  
Iv’e tried everything to add the (GetReletiveRotation) node But I cant seem to find it.  
Anything I try to do results in Not compatible.

UPDATE: MANAGED TO ADD IT Just not working at the moment.

One thing I have noticed is my original description is slightly wrong, I discoverer that I don’t have the thrusters on a socket. They are just parented , Must have been thinking of a previous attempt .

---

<div class="post-metadata">

**Author:** ![BaseReality](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/basereality/32/893179_2.png) [@BaseReality](https://forums.unrealengine.com/u/BaseReality)\
**Post date:** [March 25, 2016, 10:21am UTC](https://forums.unrealengine.com/t/how-to-rotae-a-sub-component-mesh-bases-on-forward-axis-input-acceleration/58522/9 "2016-03-25T10:21:02Z")

</div>

OK I got this working .But used a different method . Only issues iv’e got are they are spinning round really fast Continuously and the Jet fumes are not moving with them.

 ![ue4 thrusters.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/4/0/40d51ceabade248d35544d3eece60f186bf16dbc.png)

I guess I would have to parent them or place them on a socket for that to happen.
