# Rotating Camera to Shift Player Perspective when Changing Gravity Direction 

**URL:** <https://forums.unrealengine.com/t/rotating-camera-to-shift-player-perspective-when-changing-gravity-direction/2477650>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [April 27, 2025, 12:23am UTC](https://forums.unrealengine.com/t/rotating-camera-to-shift-player-perspective-when-changing-gravity-direction/2477650 "2025-04-27T00:23:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thefrankto](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@thefrankto](https://forums.unrealengine.com/u/thefrankto)\
**Post date:** [April 27, 2025, 12:23am UTC](https://forums.unrealengine.com/t/rotating-camera-to-shift-player-perspective-when-changing-gravity-direction/2477650/1 "2025-04-27T00:23:14Z")

</div>

I have a function that teleports a player to a surface and shifts their gravity based on the angle of the slope. It works great, but I’d like to rotate their camera perspective so that their new walking surface is rotated to look like the floor – basically like the world turned based on the new surface they’re walking on.

I have the directional vector I use to set my gravity direction, but how can I turn that into a rotation? Any advice would be helpful.

I think this is mostly a math issue, but either way I work primarily in blueprint. I can rotate the camera, just not find the _right_ way to rotate it.

Thanks!

---

<div class="post-metadata">

**Author:** ![VisAgilis](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/visagilis/32/891043_2.png) [@VisAgilis](https://forums.unrealengine.com/u/VisAgilis)\
**Post date:** [April 27, 2025, 5:41pm UTC](https://forums.unrealengine.com/t/rotating-camera-to-shift-player-perspective-when-changing-gravity-direction/2477650/2 "2025-04-27T17:41:22Z")

</div>

> [@thefrankto](#):
>
> I have the directional vector I use to set my gravity direction, but how can I turn that into a rotation?

 ![Screenshot 2025-04-27 204103](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/f/4/7f403629808c27aec465abcfda4204fa6d0508c9.png)

😇
