# Twin stick game issue with animations

**URL:** <https://forums.unrealengine.com/t/twin-stick-game-issue-with-animations/424086>\
**Category:** Character & Animation\
**Tags:** unreal-engine, twin-stick, question, CPP\
**Created:** [May 1, 2018, 6:14pm UTC](https://forums.unrealengine.com/t/twin-stick-game-issue-with-animations/424086 "2018-05-01T18:14:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karixs](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Karixs](https://forums.unrealengine.com/u/Karixs)\
**Post date:** [May 1, 2018, 6:14pm UTC](https://forums.unrealengine.com/t/twin-stick-game-issue-with-animations/424086/1 "2018-05-01T18:14:46Z")

</div>

Hi guys!  
I’m making Twin Stick game right now. I’m using the Anim Starter Pack and i have problem with animations. Everything works fine when player is moving forward but when i rotate him by mouse animations arent working correctly. I want to fix this issue but i dont how to do it. So im here. Here is short video which represents this issue: [CLICK HERE](https://youtu.be/_U5df0e9v-I) and here is code which im using to rotate and move the player:

```
Rotate:
void ASCharacter::RotatePlayerByMouse()
{
	FVector MouseLocation, MouseDirection, MouseLocationEnd, MouseRotation;
	FHitResult HitResult;

	UWorld* World = GetWorld();
	APlayerController* PC = World->GetFirstPlayerController();

	PC->DeprojectMousePositionToWorld(MouseLocation, MouseDirection);

	//Make trace long so it hits anything nearby.
	MouseLocationEnd = (MouseDirection * 10000) + MouseLocation;

	//Stores settings for raycast.
	FCollisionQueryParams TraceSettings;
	FCollisionResponseParams TraceResponses;

	ECollisionChannel Channel = ECollisionChannel::ECC_Visibility;

	//Do trace. If it succeeds, complete calculations and set new rotation.
	if (GetWorld()->LineTraceSingleByChannel(HitResult, MouseLocation, MouseLocationEnd, Channel, TraceSettings,
		TraceResponses) == true)
	{
		//Calculate new rotation with actor's location and hit result.
		FRotator NewRotation = UKismetMathLibrary::FindLookAtRotation(this->GetActorLocation(), HitResult.ImpactPoint);
		this->SetActorRotation(FRotator(GetControlRotation().Pitch, NewRotation.Yaw, GetControlRotation().Roll));
	}

}

Move:
void ASCharacter::MoveForward(float Value)
{
	AddMovementInput(GetActorForwardVector() * Value);
}

void ASCharacter::MoveRight(float Value)
{
	AddMovementInput(GetActorRightVector() * Value);
}

```
