# Zoom in / Out / Rotate object in front of camera

**URL:** <https://forums.unrealengine.com/t/zoom-in-out-rotate-object-in-front-of-camera/41093>\
**Category:** Community & Industry Discussion\
**Tags:** unreal-engine\
**Created:** [September 8, 2015, 1:04am UTC](https://forums.unrealengine.com/t/zoom-in-out-rotate-object-in-front-of-camera/41093 "2015-09-08T01:04:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexarg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Alexarg](https://forums.unrealengine.com/u/Alexarg)\
**Post date:** [September 8, 2015, 1:04am UTC](https://forums.unrealengine.com/t/zoom-in-out-rotate-object-in-front-of-camera/41093/1 "2015-09-08T01:04:38Z")

</div>

Hi how are you community?  
I am trying to make a system where a player could interact with an object/item and zoom in / out, rotate it.  
Something like this from Allison Road gameplay trailer:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/3/c/33cd76cd629a7c623982b2ecc4993b21648640c8.jpeg "Allison Road - Prototype Gameplay") ](https://www.youtube.com/watch?v=__i_LoRKhJ0)

Would you recommend me some approach?  
for example: simply modify the position of the object and put it in front of camera? I don’t think i could make it look “clean” but is the only think i take in mind.

Thanks!!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_760d6d78](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_760d6d78](https://forums.unrealengine.com/u/anonymous_user_760d6d78)\
**Post date:** [September 8, 2015, 1:21am UTC](https://forums.unrealengine.com/t/zoom-in-out-rotate-object-in-front-of-camera/41093/2 "2015-09-08T01:21:27Z")

</div>

I think you’d need a controller to possess that object so that input commands would work with it. You would then need to map out exactly what those input actions do, like using the mouse wheel to scroll in and out, and you would place those inside the event graph of the object you are interacting with. Then I guess you could try using an arrow component to position where you want the object relative to your camera and play an animation that places that object at the point of that arrow. I don’t know how to implement it but I’m guessing that should be able to point you to an acceptable solution.

---

<div class="post-metadata">

**Author:** ![Kris](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kris/32/758129_2.png) [@Kris](https://forums.unrealengine.com/u/Kris)\
**Post date:** [September 8, 2015, 1:48am UTC](https://forums.unrealengine.com/t/zoom-in-out-rotate-object-in-front-of-camera/41093/3 "2015-09-08T01:48:52Z")

</div>

Interpolate the location & rotation of the object to a fixed location & rotation in front of the camera.  
You may need to use a bit of math to adjust this location based on the size of the object.  
The interpolation could be controlled via tick, timer or curve - up to you.

While an object is held, redirect what ever input you wish to use to manipulate the object rotation & camera field of view.

Once done, interpolate the location & rotation of the object back to its original positional an reset the camera field of view.

---

<div class="post-metadata">

**Author:** ![Alexarg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Alexarg](https://forums.unrealengine.com/u/Alexarg)\
**Post date:** [September 8, 2015, 1:55am UTC](https://forums.unrealengine.com/t/zoom-in-out-rotate-object-in-front-of-camera/41093/4 "2015-09-08T01:55:15Z")

</div>

> [@Kris;374094](#):
>
> Interpolate the location & rotation of the object to a fixed location & rotation in front of the camera.  
> You may need to use a bit of math to adjust this location based on the size of the object.  
> The interpolation could be controlled via tick, timer or curve - up to you.
> 
> While an object is held, redirect what ever input you wish to use to manipulate the object rotation & camera field of view.
> 
> Once done, interpolate the location & rotation of the object back to its original positional an reset the camera field of view.

ok i think i will going this way =)  
thanks Kris and kthor94 for the help!

---

<div class="post-metadata">

**Author:** ![Alexarg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Alexarg](https://forums.unrealengine.com/u/Alexarg)\
**Post date:** [September 9, 2015, 11:35pm UTC](https://forums.unrealengine.com/t/zoom-in-out-rotate-object-in-front-of-camera/41093/5 "2015-09-09T23:35:46Z")

</div>

Hi, Today I finally could work a little with this and get this:

[![]( " - YouTube") ](https://www.youtube.com/watch?v=Q-AkTu1Dvy0)

Now i have other question, Is there a proper way to map two different actions to same keyboard key?  
Example:  
My Pawn walks with WASD keys, but when I have the item “Zoom in” I want that WASD rotates the item instead and prevent the player movement  
I know I can make a simple If(bIsExaminingItem) on “Walk” function and if true just rotate the “current item in view” and skip the walk/move code.  
But there is a “nicely” way of do this?

(Sorry for the video quality, is just for explain myself better due my English isn’t good)  
Thanks!

---

<div class="post-metadata">

**Author:** ![Kris](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kris/32/758129_2.png) [@Kris](https://forums.unrealengine.com/u/Kris)\
**Post date:** [September 11, 2015, 4:19am UTC](https://forums.unrealengine.com/t/zoom-in-out-rotate-object-in-front-of-camera/41093/6 "2015-09-11T04:19:32Z")

</div>

Can either be done in C++ / BP like you’re doing it now or you could use the capture / release input Blueprint nodes to reroute input as required.  
Up to you what you prefer to use.  
They all get the job done.

---

<div class="post-metadata">

**Author:** ![TechLord](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/techlord/32/1040563_2.png) [@TechLord](https://forums.unrealengine.com/u/TechLord)\
**Post date:** [September 18, 2015, 12:44am UTC](https://forums.unrealengine.com/t/zoom-in-out-rotate-object-in-front-of-camera/41093/7 "2015-09-18T00:44:41Z")

</div>

> [@kthor94;374081](#):
>
> I think you’d need a controller to possess that object so that input commands would work with it. You would then need to map out exactly what those input actions do, like using the mouse wheel to scroll in and out, and you would place those inside the event graph of the object you are interacting with. Then I guess you could try using an arrow component to position where you want the object relative to your camera and play an animation that places that object at the point of that arrow. I don’t know how to implement it but I’m guessing that should be able to point you to an acceptable solution.

> [@Kris;374094](#):
>
> Interpolate the location & rotation of the object to a fixed location & rotation in front of the camera.  
> You may need to use a bit of math to adjust this location based on the size of the object.  
> The interpolation could be controlled via tick, timer or curve - up to you.
> 
> While an object is held, redirect what ever input you wish to use to manipulate the object rotation & camera field of view.
> 
> Once done, interpolate the location & rotation of the object back to its original positional an reset the camera field of view.

Hello Kris, to clarify, this solution does not require possession? I personally would be grateful to anyone with a snapshot of the basic BP node set up for this.
