# Rotation around the Pitch axis is bugged?

**URL:** <https://forums.unrealengine.com/t/rotation-around-the-pitch-axis-is-bugged/286937>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [June 28, 2014, 9:19am UTC](https://forums.unrealengine.com/t/rotation-around-the-pitch-axis-is-bugged/286937 "2014-06-28T09:19:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbrizov](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dbrizov](https://forums.unrealengine.com/u/dbrizov)\
**Post date:** [June 28, 2014, 9:19am UTC](https://forums.unrealengine.com/t/rotation-around-the-pitch-axis-is-bugged/286937/1 "2014-06-28T09:19:39Z")

</div>

Hi, I am making a simple Pickup actor and on the Tick function I want to rotate it with the FRotator(15, 30, 45) each second. I encountered a strange bug (The rotation around the Pitch axis locks after 90deg). I wan’t to do this via C++ so please don’t answer with blueprints.

Here is the code if it might help:

```
// Pickup.h

UCLASS()
class APickup : public AActor
{
	GENERATED_UCLASS_BODY()

public:
	/** The root component of the pickup object */
	UPROPERTY(VisibleDefaultsOnly, BlueprintReadOnly, Category = "Components")
	TSubobjectPtr<USceneComponent> SceneComponent;

	/** The static mesh of the pickup object */
	UPROPERTY(VisibleDefaultsOnly, BlueprintReadOnly, Category = "Components")
	TSubobjectPtr<UStaticMeshComponent> PickupMesh;

	/** The rotation rate of the pickup object in degrees/second for each axis of the FRotator */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Rotation")
	FRotator RotationRate;

	virtual void Tick(float DeltaTime) override;
};

// Pickup.cpp

APickup::APickup(const FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)
{
	this->PrimaryActorTick.bCanEverTick = true;

	this->SceneComponent = PCIP.CreateDefaultSubobject<USceneComponent>(this, TEXT("SceneComponent"));
	this->RootComponent = this->SceneComponent;

	this->PickupMesh = PCIP.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("PickupMesh"));
	this->PickupMesh->AttachTo(this->RootComponent);

	this->RotationRate = FRotator(15.0f, 30.0f, 45.0f);
}

void APickup::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

	this->SetActorRotation(this->GetActorRotation() + (this->RotationRate * DeltaTime));
}

```

---

<div class="post-metadata">

**Author:** ![AnxGotta](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AnxGotta](https://forums.unrealengine.com/u/AnxGotta)\
**Post date:** [June 28, 2014, 1:45pm UTC](https://forums.unrealengine.com/t/rotation-around-the-pitch-axis-is-bugged/286937/2 "2014-06-28T13:45:30Z")

</div>

I would try changing your code to match my answer to your similar question **[here](https://answers.unrealengine.com/questions/62207/roll-pitch-yaw-rotations-strange-behavior.html)** and see if that fixes both problems for you.

---

<div class="post-metadata">

**Author:** ![dbrizov](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dbrizov](https://forums.unrealengine.com/u/dbrizov)\
**Post date:** [June 28, 2014, 3:25pm UTC](https://forums.unrealengine.com/t/rotation-around-the-pitch-axis-is-bugged/286937/3 "2014-06-28T15:25:50Z")

</div>

Yeap, it is actually the same code. Thanks again mate. Works perfectly 🙂

---

<div class="post-metadata">

**Author:** ![AnxGotta](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AnxGotta](https://forums.unrealengine.com/u/AnxGotta)\
**Post date:** [June 28, 2014, 4:00pm UTC](https://forums.unrealengine.com/t/rotation-around-the-pitch-axis-is-bugged/286937/4 "2014-06-28T16:00:38Z")

</div>

Awesome. Glad it worked!

---

<div class="post-metadata">

**Author:** ![Pelangi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pelangi](https://forums.unrealengine.com/u/Pelangi)\
**Post date:** [May 25, 2015, 1:20pm UTC](https://forums.unrealengine.com/t/rotation-around-the-pitch-axis-is-bugged/286937/5 "2015-05-25T13:20:16Z")

</div>

If you possess a `Pawn` and try to rotate it in any direction, you’ll be limited to 90% in any direction. It’s a bug acknowledged by Unreal developers.

If you are using blueprint, you can do the rotation in your custom `PlayerController` blueprint and freely rotate 360 degrees without limit. The rotation values (roll, yaw, pitch) can even exceed 360 degrees and it’ll work perfectly. So rotate the actor from within your `PlayerController` blueprint instead of your individual `Pawn` blueprint.
