# Weird Quaternion behaviour

**URL:** <https://forums.unrealengine.com/t/weird-quaternion-behaviour/474674>\
**Category:** Community & Industry Discussion\
**Tags:** rotator, rotation, unreal-engine, transform, vector, question\
**Created:** [November 18, 2020, 5:35pm UTC](https://forums.unrealengine.com/t/weird-quaternion-behaviour/474674 "2020-11-18T17:35:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_17b478571](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_17b478571](https://forums.unrealengine.com/u/anonymous_user_17b478571)\
**Post date:** [November 18, 2020, 5:35pm UTC](https://forums.unrealengine.com/t/weird-quaternion-behaviour/474674/1 "2020-11-18T17:35:07Z")

</div>

Hi, Iam trying to rotate an object with a VR controller.

When I set the rotation of the object to my vr controller rotation, the result is exactly how I want it.

```
			myObject->SetWorldRotation(leftController->GetActorRotation());

```

That works.

But if I want to make the rotation change gradually, so that the controller rotation is added to the object, instead of set to match the controller, the behaviour is all weird. It rotates very weirdly and doesn’t match what the controller is doing.

```
FQuat lastFrameRotation;

 void TickComponent(){
    
    FQuat difference = leftController->GetActorRotation() * lastFrameRotation.Inverse();

    myObject->SetWorldRotation(myObject->GetComponentRotation() * difference );

    lastFrameRotation = leftController->GetActorRotation();

 }

```

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_17b478571](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_17b478571](https://forums.unrealengine.com/u/anonymous_user_17b478571)\
**Post date:** [November 19, 2020, 6:30am UTC](https://forums.unrealengine.com/t/weird-quaternion-behaviour/474674/2 "2020-11-19T06:30:57Z")

</div>

Using AddWorldRotation instead of setting the rotation myself did the trick.
