# Is there a way to lock the axis on a Pawn/Character BP?

**URL:** <https://forums.unrealengine.com/t/is-there-a-way-to-lock-the-axis-on-a-pawn-character-bp/286442>\
**Category:** World Creation\
**Tags:** axis, unreal-engine, constraint, Physics, Blueprint, question\
**Created:** [June 21, 2014, 12:43pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-lock-the-axis-on-a-pawn-character-bp/286442 "2014-06-21T12:43:40Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![CardDeath](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CardDeath](https://forums.unrealengine.com/u/CardDeath)\
**Post date:** [June 21, 2014, 12:43pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-lock-the-axis-on-a-pawn-character-bp/286442/1 "2014-06-21T12:43:40Z")

</div>

Hi all, my main problem at the moment is I am making a pong style game to test my understanding within the engine. The ball currently fires with a set velocity and then keep the same velocity as it hits every paddle however it sometimes knocks the paddle backwards. I tried to set the actor location to the default Y axis using a bool to make it snap back to the correct location but it looks too jaunting.

 ![8913-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/5/7/b57d1fd2ec11c6a9c5c9cb33bd6d48efd5301489.png)

I was hoping that there was a simple button like Unity where you could lock constraints on particular rotation and location axis so it could never move on the Y axis however I have been unable to find anything like that. I might just be missing something and if so a simple solution would be great, if not is there a way in blueprint to stop it from moving?

Thank you very much!

---

<div class="post-metadata">

**Author:** ![kylawl](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kylawl](https://forums.unrealengine.com/u/kylawl)\
**Post date:** [July 30, 2014, 10:29pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-lock-the-axis-on-a-pawn-character-bp/286442/2 "2014-07-30T22:29:19Z")

</div>

I was looking for this as well. Haven’t found anything yet.

---

<div class="post-metadata">

**Author:** ![kylawl](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kylawl](https://forums.unrealengine.com/u/kylawl)\
**Post date:** [July 31, 2014, 5:54am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-lock-the-axis-on-a-pawn-character-bp/286442/3 "2014-07-31T05:54:35Z")

</div>

So all you need to do to make this work is:

- Attach a PhysicsConstraintComponent
- Set Constraint Component 1 to be the name of the root component of your actor.
- Leaving Constraint Component 2 empty will constrain the actor to the world
- Lock/Free the particular axis set to get the plane you want. for example Free X,Y Lock Z will give you an actor that can move freely only on the xy plane and will not move up and down. Rotations work in revers Swing Angle 1 is Z, Swing Angle 2 is Y and Twist Angle is X. If XY is your 2d plane, then you want to set Swing Angle 1 to free, Swing Angle 2 and Twist to Locked.

---

<div class="post-metadata">

**Author:** ![Josh\_S](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Josh\_S](https://forums.unrealengine.com/u/Josh_S)\
**Post date:** [October 26, 2014, 4:17am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-lock-the-axis-on-a-pawn-character-bp/286442/4 "2014-10-26T04:17:14Z")

</div>

Worked great for me! 🙂

---

<div class="post-metadata">

**Author:** ![Mewbits](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mewbits/32/1194714_2.png) [@Mewbits](https://forums.unrealengine.com/u/Mewbits)\
**Post date:** [May 8, 2016, 4:20pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-lock-the-axis-on-a-pawn-character-bp/286442/5 "2016-05-08T16:20:10Z")

</div>

On our 3D Side scroller game, we Constrained movement to the YZ axis, however, my character’s attacks are still able to throw the enemy along the x axis. How do I prevent this?

---

<div class="post-metadata">

**Author:** ![VinnyBlood](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@VinnyBlood](https://forums.unrealengine.com/u/VinnyBlood)\
**Post date:** [February 17, 2019, 6:07pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-lock-the-axis-on-a-pawn-character-bp/286442/6 "2019-02-17T18:07:30Z")

</div>

I think you have “constrain to plane” option in Character Movement component

---

<div class="post-metadata">

**Author:** ![Brandozer1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brandozer1](https://forums.unrealengine.com/u/Brandozer1)\
**Post date:** [October 22, 2020, 3:56am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-lock-the-axis-on-a-pawn-character-bp/286442/7 "2020-10-22T03:56:15Z")

</div>

I was able to figure it out by using the “SetActorLocation”. You can set the number value of your locked axis, then connect the other 2 axes to “GetWorldLocation” of the same object.

---

<div class="post-metadata">

**Author:** ![Brandozer1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brandozer1](https://forums.unrealengine.com/u/Brandozer1)\
**Post date:** [October 22, 2020, 3:58am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-lock-the-axis-on-a-pawn-character-bp/286442/8 "2020-10-22T03:58:00Z")

</div>

Also don’t forget you can split the individual axis on those commands via right click and split.

---

<div class="post-metadata">

**Author:** ![MaxBotvinev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/maxbotvinev/32/975035_2.png) [@MaxBotvinev](https://forums.unrealengine.com/u/MaxBotvinev)\
**Post date:** [March 14, 2021, 5:37pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-lock-the-axis-on-a-pawn-character-bp/286442/9 "2021-03-14T17:37:23Z")

</div>

The most clean way.

---

<div class="post-metadata">

**Author:** ![Roblesliemedia](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roblesliemedia/32/587970_2.png) [@Roblesliemedia](https://forums.unrealengine.com/u/Roblesliemedia)\
**Post date:** [May 12, 2021, 5:49am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-lock-the-axis-on-a-pawn-character-bp/286442/10 "2021-05-12T05:49:34Z")

</div>

This is exactly what I needed to find and it worked perfectly. Was quite stumped and I am vey thankful. The bonus reply that is the most clean way was nice as well.

---

<div class="post-metadata">

**Author:** ![Jase2111](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jase2111/32/1194612_2.png) [@Jase2111](https://forums.unrealengine.com/u/Jase2111)\
**Post date:** [June 10, 2022, 9:24pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-lock-the-axis-on-a-pawn-character-bp/286442/11 "2022-06-10T21:24:02Z")

</div>

Didn’t work for me.
