# Turn mouse input into rotation?

**URL:** <https://forums.unrealengine.com/t/turn-mouse-input-into-rotation/259336>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [November 4, 2021, 8:06pm UTC](https://forums.unrealengine.com/t/turn-mouse-input-into-rotation/259336 "2021-11-04T20:06:20Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Marius557](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Marius557](https://forums.unrealengine.com/u/Marius557)\
**Post date:** [November 5, 2021, 3:50am UTC](https://forums.unrealengine.com/t/turn-mouse-input-into-rotation/259336/2 "2021-11-05T03:50:03Z")

</div>

I can’t understand the code. But I do know that UE provides an out-of-the-box way of converting input to pawn/character movement.

Binding mouse input to movement can be done with the following two steps. The example will be for using the mouse to rotate the character.

1. Setup your input bindings in project settings.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/c/7/c76974279200fcf2b90aca1cd729ba1391b2bd72.png)

1. Bind the input to AddControllerYawInput in SetupPlayerInputComponent.

```auto
void ACharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
  PlayerInputComponent->BindAxis(TEXT("Rotate"), this, &APawn::AddControllerYawInput);
}

```

---

_[View the full topic](https://forums.unrealengine.com/t/turn-mouse-input-into-rotation/259336)._
