# Quaternion Up Vector Intersect Issue

**URL:** <https://forums.unrealengine.com/t/quaternion-up-vector-intersect-issue/482304>\
**Category:** Community & Industry Discussion\
**Tags:** pitch, rotation, unreal-engine, question\
**Created:** [April 22, 2021, 9:09am UTC](https://forums.unrealengine.com/t/quaternion-up-vector-intersect-issue/482304 "2021-04-22T09:09:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anonythe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonythe](https://forums.unrealengine.com/u/Anonythe)\
**Post date:** [April 22, 2021, 9:09am UTC](https://forums.unrealengine.com/t/quaternion-up-vector-intersect-issue/482304/1 "2021-04-22T09:09:07Z")

</div>

Dear Community,

I run into an issue since months : Rotation snap + jitter on the Pitch axis at 90 and -90 degrees with rotation matrix or quaternions!

**The situation** : I rotate a Pawn around a Sphere. The location of the Pawn and the Sphere are the same. My keyboard keys are used to move (Up/Down and Left/Right). The Pawn is composed of these hierarchical elements : Collision Box (root) \> Scene \> Spring Arm (with Lag) \> Camera.

**Here is a video of the problem :** [https://drive.google.com/file/d/1GIroYocDp3GmvCfBf7hJfMmhYlU\_DHm4/view?usp=sharing](https://drive.google.com/file/d/1GIroYocDp3GmvCfBf7hJfMmhYlU_DHm4/view?usp=sharing)

**The last and best code currently (in Pawn) :**

```
FQuat Old = this->GetActorRotation().Quaternion();

FQuat Delta;
(iMoveX) ? Delta = FQuat::MakeFromEuler(FVector(0.0f, Calculation, 0.0f)) : Delta = FQuat::MakeFromEuler(FVector(0.0f, 0.0f, Calculation));

FQuat New = Old * Delta;

this->SetActorRotation(New);

```

I tried a lot of different methods with matrix and quaternions, in local or world space, with or without FRotators… But I always encounter this issue only on the pitch axis.

Thank you for help!

---

<div class="post-metadata">

**Author:** ![Anonythe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonythe](https://forums.unrealengine.com/u/Anonythe)\
**Post date:** [April 23, 2021, 2:37pm UTC](https://forums.unrealengine.com/t/quaternion-up-vector-intersect-issue/482304/2 "2021-04-23T14:37:04Z")

</div>

Dear Community,

I created a blank project to try if the problem exists out of box, and it is.

You can **dowload this project** out there : [QuatTest\_426.zip - Google Drive](https://drive.google.com/file/d/1MiMmspXLSL9k9quJkdY_6XSXPDecx9nw/view?usp=sharing)

Hit Play then F1 to see the sphere wireframe. Use Z to move up (S for down) and try to align with 90 degrees (open Output Log to see the pitch value). You can notice that the pawn stops and locks on the 90 degree. Warning : It’s very subtle, and if you go too fast it won’t stop. I use a lot of rotations in my space game and I often reach 90 degrees’ pitch, so it’s really painful 😕

This problem occurs with _FRotator_, _FRotationMatrix_ and _Quaternions_. In _local_ and _world_ spaces. And with _AddLocationRotation_ or _SetActorRotation_ functions (_MoveComponent_ related).

I upvoted the case **[UE-58446](https://issues.unrealengine.com/issue/UE-58446)** which seems to be the same.

I hope someone can confirm or even take a look in the engine.

Thanks!
