# Rotate object 360 relative to camera

**URL:** <https://forums.unrealengine.com/t/rotate-object-360-relative-to-camera/481327>\
**Category:** Cinematics & Media\
**Tags:** rotation, axis, Motion-Controller, unreal-engine, question\
**Created:** [April 3, 2021, 6:31pm UTC](https://forums.unrealengine.com/t/rotate-object-360-relative-to-camera/481327 "2021-04-03T18:31:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bonatti-San](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bonatti-San](https://forums.unrealengine.com/u/Bonatti-San)\
**Post date:** [April 3, 2021, 6:31pm UTC](https://forums.unrealengine.com/t/rotate-object-360-relative-to-camera/481327/1 "2021-04-03T18:31:28Z")

</div>

Ok, I’m scratching my head about this.

I’m trying to rotate an object on X and Y axis relative to camera, but the Z relative to the world.

It’s a VR prototype, but the problem is not exclusive to VR. So I want the XY be the motion controller relative to the player rotation. For example: If the player tilt row (Y) while looking north, the object will rotate the Y axis. If looking east, will rotate X axis, and so on.

And the Z always fixed.

The problem is, when reach 90 degrees, the rotation goes crazy. Looks like it’s a problem with quaternion, which I didn’t understand nothing. lmao

I’m out of ideas. Anyone knows how to fix that?

What I’m trying to do:

 ![334605-problem.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/4/7/34733e314b4abf724a84b272d5748710b6db3e3e.png)

The best solution I found but still the rotation go crazy:

 ![334604-solution.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/2/5/725e85ab868529369ca70e82faf8961cfe601e9f.png)
