# How can I rotate camera around player using right virtual joystick?

**URL:** <https://forums.unrealengine.com/t/how-can-i-rotate-camera-around-player-using-right-virtual-joystick/342812>\
**Category:** Character & Animation\
**Tags:** controls-mapping, unreal-engine, joystick, question\
**Created:** [December 31, 2015, 5:04pm UTC](https://forums.unrealengine.com/t/how-can-i-rotate-camera-around-player-using-right-virtual-joystick/342812 "2015-12-31T17:04:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anaklosmos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anaklosmos](https://forums.unrealengine.com/u/Anaklosmos)\
**Post date:** [December 31, 2015, 5:04pm UTC](https://forums.unrealengine.com/t/how-can-i-rotate-camera-around-player-using-right-virtual-joystick/342812/1 "2015-12-31T17:04:22Z")

</div>

I am attempting to get player control with left virtual joystick and I would like to be able to spin camera around player with right joystick. This is all being done in ball rolling example map. How would I go about controlling camera with right stick but still constraining it to same distance from my character and always keeping my character centered within camera view? Thanks.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_33800a51](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_33800a51](https://forums.unrealengine.com/u/anonymous_user_33800a51)\
**Post date:** [December 31, 2015, 10:57pm UTC](https://forums.unrealengine.com/t/how-can-i-rotate-camera-around-player-using-right-virtual-joystick/342812/2 "2015-12-31T22:57:35Z")

</div>

Hi Anaklosmos,

Since PhysicsBallBP Pawn in Rolling template is already using a SpringArm component to maintain distance between Ball and Camera, this is a pretty easy thing to implement. You’ll notice that Transform of SpringArm component is set to AbsoluteRotation. By changing Z to 90, you’ll see it has maintained distance between camera and ball components, but rotated to face ball from another direction.

easiest way to set this up is by adding another Input to turn camera (Edit \> Project Settings \> Input) as follows:

![72484-turncamerainput.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/7/f/67f8384164fcf66f62a3b51689c2f03bcbda68b6.png)

Then, in Event Graph for PhysicsBallBP, add following:

 ![72485-turnballcam.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/0/f/00ffa2f6d590866c92091480e794baf57810e831.png)

This will take Axis input from Right Thumbstick (-1 to 1) and add rotation to Spring Arm. This occurs on tick, so it’s a nice smooth movement, but you can adjust this by multiplying or dividing Axis Value before plugging it into Make Rotator Z input.

Hope that helps!

---

<div class="post-metadata">

**Author:** ![Anaklosmos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anaklosmos](https://forums.unrealengine.com/u/Anaklosmos)\
**Post date:** [January 1, 2016, 7:27am UTC](https://forums.unrealengine.com/t/how-can-i-rotate-camera-around-player-using-right-virtual-joystick/342812/3 "2016-01-01T07:27:09Z")

</div>

This setup works, however, it does not update ball controls to direction in which camera is facing. Ex. When I rotate 90 degrees clockwise, and push up on virtual joystick, expecting ball to roll forward in relation to camera view, it will roll left. Simply put, controls stay consistent when they should be updated based on camera view. How can I fix this so that ball will always roll correct direction in relation to camera and joystick? Thanks

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_33800a51](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_33800a51](https://forums.unrealengine.com/u/anonymous_user_33800a51)\
**Post date:** [January 2, 2016, 11:24pm UTC](https://forums.unrealengine.com/t/how-can-i-rotate-camera-around-player-using-right-virtual-joystick/342812/4 "2016-01-02T23:24:00Z")

</div>

Ah, okay, in that case you also need to rotate vector you’re using for Torque to match Spring Arm’s new rotation. It should look like this:

 ![72642-rotatevector.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/3/7/337b3df0b6d1ab4dc9dc1ca1152d40a2693c184d.png)

You’ll want to do same for Roll Forwards/Backwards controls.

---

<div class="post-metadata">

**Author:** ![Anaklosmos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anaklosmos](https://forums.unrealengine.com/u/Anaklosmos)\
**Post date:** [January 3, 2016, 5:33am UTC](https://forums.unrealengine.com/t/how-can-i-rotate-camera-around-player-using-right-virtual-joystick/342812/5 "2016-01-03T05:33:30Z")

</div>

Awesome! That worked perfectly! Thanks so much!

---

<div class="post-metadata">

**Author:** ![somethingstarted](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@somethingstarted](https://forums.unrealengine.com/u/somethingstarted)\
**Post date:** [June 25, 2016, 8:55am UTC](https://forums.unrealengine.com/t/how-can-i-rotate-camera-around-player-using-right-virtual-joystick/342812/6 "2016-06-25T08:55:41Z")

</div>

what is that node with X that attaches from InputAxis \> ??? \>\> Make VEctor?

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [July 11, 2016, 5:29pm UTC](https://forums.unrealengine.com/t/how-can-i-rotate-camera-around-player-using-right-virtual-joystick/342812/7 "2016-07-11T17:29:17Z")

</div>

It’s a multiplication node. Type in \* to access it in blueprints.

---

<div class="post-metadata">

**Author:** ![tonycapp21](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tonycapp21](https://forums.unrealengine.com/u/tonycapp21)\
**Post date:** [September 3, 2018, 3:39am UTC](https://forums.unrealengine.com/t/how-can-i-rotate-camera-around-player-using-right-virtual-joystick/342812/8 "2018-09-03T03:39:44Z")

</div>

Sorry to ask, but using that same layout I cant seem to get my forward/backward controls to work. Is there anything different or is it completely identical to right/left? Right/left works perfectly.

Thanks!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7fc96ff81](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7fc96ff81](https://forums.unrealengine.com/u/anonymous_user_7fc96ff81)\
**Post date:** [October 19, 2018, 1:42am UTC](https://forums.unrealengine.com/t/how-can-i-rotate-camera-around-player-using-right-virtual-joystick/342812/9 "2018-10-19T01:42:20Z")

</div>

Just do Same to Roll Forwards/Backwards.

I just copied and pasted GetWorldRotation, and Rotate Vector, and connected it up like my picture.  
If you cant get it to work, just reply!

 ![257005-unreal-example-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/f/7/3f78659cd55b5bc4a79bb8aabb61279f3f6429e4.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b2456c86](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b2456c86](https://forums.unrealengine.com/u/anonymous_user_b2456c86)\
**Post date:** [October 6, 2020, 10:05pm UTC](https://forums.unrealengine.com/t/how-can-i-rotate-camera-around-player-using-right-virtual-joystick/342812/10 "2020-10-06T22:05:30Z")

</div>

I used instead of Spring Arm Camera then it worked. Thanks

---

<div class="post-metadata">

**Author:** ![Dipesh1510](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dipesh1510](https://forums.unrealengine.com/u/Dipesh1510)\
**Post date:** [February 6, 2021, 3:23pm UTC](https://forums.unrealengine.com/t/how-can-i-rotate-camera-around-player-using-right-virtual-joystick/342812/11 "2021-02-06T15:23:14Z")

</div>

This setup is not working in ue4.25 can anyone help me out ?
