# How can I clamp the axis input from 'dragging' out of range?

**URL:** <https://forums.unrealengine.com/t/how-can-i-clamp-the-axis-input-from-dragging-out-of-range/365540>\
**Category:** Blueprint\
**Tags:** axis, unreal-engine, clamp, controls, UE4, Blueprint, question\
**Created:** [July 29, 2016, 9:49am UTC](https://forums.unrealengine.com/t/how-can-i-clamp-the-axis-input-from-dragging-out-of-range/365540 "2016-07-29T09:49:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_317a37b21](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_317a37b21](https://forums.unrealengine.com/u/anonymous_user_317a37b21)\
**Post date:** [July 29, 2016, 9:49am UTC](https://forums.unrealengine.com/t/how-can-i-clamp-the-axis-input-from-dragging-out-of-range/365540/1 "2016-07-29T09:49:54Z")

</div>

Hi,  
I’m using the axis input in the character blueprint to directly control bones on the player character. Whilst this is working fine, I have an issue where the further you move the mouse/stick in a direction, that point will carry on passed where the mesh of the character can stretch to and beyond to some invisible point. You then have to hold the stick/move the mouse back in the opposite direction for the same amount of time before this invisible movement point comes back to move the bone correctly.

ie. I hold right on the control stick the character’s hand moves right until the arm is stretched, if I continue to hold right for a minute after this point I then have to hold left for a minute until the arm will move left again.

I’m not sure what’s causing it. I can clamp the position of the mesh without problem, and I’ve tried clamping right after the Inputaxis, but this continuous ‘dragging’ movement carries on. Any ideas?

---

<div class="post-metadata">

**Author:** ![NoobsDeSroobs](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NoobsDeSroobs](https://forums.unrealengine.com/u/NoobsDeSroobs)\
**Post date:** [July 29, 2016, 9:58am UTC](https://forums.unrealengine.com/t/how-can-i-clamp-the-axis-input-from-dragging-out-of-range/365540/2 "2016-07-29T09:58:05Z")

</div>

By using clamp? Just put the value in and then clamp between 0 and armLength.

You have to clamp the variable that you are adding the axis value to.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_317a37b21](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_317a37b21](https://forums.unrealengine.com/u/anonymous_user_317a37b21)\
**Post date:** [July 29, 2016, 11:12am UTC](https://forums.unrealengine.com/t/how-can-i-clamp-the-axis-input-from-dragging-out-of-range/365540/3 "2016-07-29T11:12:09Z")

</div>

Wow, I feel daft. I was literally putting the clamp in the wrong place. Thank you!
