# Return camera position to its first place

**URL:** <https://forums.unrealengine.com/t/return-camera-position-to-its-first-place/373126>\
**Category:** Blueprint\
**Tags:** unreal-engine, question, Blueprint\
**Created:** [October 12, 2016, 12:51pm UTC](https://forums.unrealengine.com/t/return-camera-position-to-its-first-place/373126 "2016-10-12T12:51:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LDinos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LDinos](https://forums.unrealengine.com/u/LDinos)\
**Post date:** [October 12, 2016, 12:51pm UTC](https://forums.unrealengine.com/t/return-camera-position-to-its-first-place/373126/1 "2016-10-12T12:51:45Z")

</div>

So generally I want to create a DayZ style game. It has a pretty cool camera trick in which, when ALT is not pressed, the character is moved along the camera rotation (“Use Controller Rotation Yaw” = off) and when it is pressed, I am allowed to look around me, without the character moving (“Use Controller Rotation Yaw” = on). When ALT is released, I want the camera to go back to where the character is looking just before I pressed alt (in my case, the CHARACTER rotates to where the camera was looking just before I released ALT). Any ideas would be helpful 🙂  
Sorry if I am not too understantable.

Here is how I made the simple ALT system

 ![110510-χωρίς+τίτλο.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/9/b/69bd5420e7e84b3b5be89c8110b966cd5f049d4a.png)

I also hope this video helps: [24 Hour Stream Highlights! DayZ Standalone Gameplay. - YouTube](https://www.youtube.com/watch?v=Lpkw3zN6KfU)  
(Check 0:11 - 0:16 how the camera returned to its original place when he released the ALT button)

---

<div class="post-metadata">

**Author:** ![Luxiam](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Luxiam](https://forums.unrealengine.com/u/Luxiam)\
**Post date:** [October 12, 2016, 12:56pm UTC](https://forums.unrealengine.com/t/return-camera-position-to-its-first-place/373126/2 "2016-10-12T12:56:17Z")

</div>

How about saving the direction the camera was at the moment you press alt and use that variable to switch it back to its original orientation when you release it.

To do this you can use the function SetWorldRotation.

![110651-setworldrotation.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/b/e/1bee2b5cbbd8ed24898d5f52329b8e1af9e810ee.png)

---

<div class="post-metadata">

**Author:** ![LDinos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LDinos](https://forums.unrealengine.com/u/LDinos)\
**Post date:** [October 12, 2016, 1:08pm UTC](https://forums.unrealengine.com/t/return-camera-position-to-its-first-place/373126/3 "2016-10-12T13:08:57Z")

</div>

I have a hard time finding the command to set the rotation of the camera back to the saved rotator variable

---

<div class="post-metadata">

**Author:** ![Luxiam](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Luxiam](https://forums.unrealengine.com/u/Luxiam)\
**Post date:** [October 13, 2016, 10:57am UTC](https://forums.unrealengine.com/t/return-camera-position-to-its-first-place/373126/4 "2016-10-13T10:57:29Z")

</div>

I updated the answer with the function.
