# How to sync controls with camera in rolling ball templete

**URL:** <https://forums.unrealengine.com/t/how-to-sync-controls-with-camera-in-rolling-ball-templete/109877>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [April 22, 2018, 4:28am UTC](https://forums.unrealengine.com/t/how-to-sync-controls-with-camera-in-rolling-ball-templete/109877 "2018-04-22T04:28:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sphinix257](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sphinix257](https://forums.unrealengine.com/u/sphinix257)\
**Post date:** [April 22, 2018, 4:28am UTC](https://forums.unrealengine.com/t/how-to-sync-controls-with-camera-in-rolling-ball-templete/109877/1 "2018-04-22T04:28:27Z")

</div>

ok. so i have opened up the rolling ball template and played with the code a bit, and ive got a lot of cool things added.  
most importantly i have added an option to rotate the camera around the ball so its not a side scroller any more.

but i cant for the life of me figure out how to sync the controls with the camera direction. if i turn my camera to look any direction but forward. the ball will still roll in the same direction despite turning the camera. if i get what i want the ball should roll forward based of the current camera direction, but it currently pulls from the transform axis of the mesh.

im trying to replicate a control scheme from an old game called marble blast ultra.  
example video here:[https://www.youtube.com/watch?v=kfkcmJ8vxZU](https://www.youtube.com/watch?v=kfkcmJ8vxZU)

---

<div class="post-metadata">

**Author:** ![EvilCleric](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EvilCleric](https://forums.unrealengine.com/u/EvilCleric)\
**Post date:** [April 22, 2018, 10:30am UTC](https://forums.unrealengine.com/t/how-to-sync-controls-with-camera-in-rolling-ball-templete/109877/2 "2018-04-22T10:30:40Z")

</div>

Did you kept the BP for the “MoveRight” and “MoveForward” or did you change it?

Also, how did you set: the “Use Controller Rotation X” in the class defaults and the “Use Pawn Control Rotation” of the spring arm?

To have the ball roll in direction of the camera just do this:

 ![forward.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/7/f/7f926889ba279e88eb2c63e90fddc5a5c0db7177.png)

---

<div class="post-metadata">

**Author:** ![sphinix257](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sphinix257](https://forums.unrealengine.com/u/sphinix257)\
**Post date:** [April 22, 2018, 3:01pm UTC](https://forums.unrealengine.com/t/how-to-sync-controls-with-camera-in-rolling-ball-templete/109877/3 "2018-04-22T15:01:53Z")

</div>

Cool. Ill give this a try. But for reference. Just so im learning and not just doing.

How is it determining axis to rotate. And force to apply off 1 vector value. I figured that was just enough information to tell it where to pivit the rotation

edit i tried the modification. and it didnt seem to work

​

---

<div class="post-metadata">

**Author:** ![EvilCleric](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EvilCleric](https://forums.unrealengine.com/u/EvilCleric)\
**Post date:** [April 22, 2018, 3:41pm UTC](https://forums.unrealengine.com/t/how-to-sync-controls-with-camera-in-rolling-ball-templete/109877/4 "2018-04-22T15:41:19Z")

</div>

Sorry, I forgot the MoveRight part:

 ![right.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/1/d/1de0eb1b5d9997789cadffce371c2455bc885b4c.png)

---

<div class="post-metadata">

**Author:** ![EvilCleric](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EvilCleric](https://forums.unrealengine.com/u/EvilCleric)\
**Post date:** [April 22, 2018, 4:44pm UTC](https://forums.unrealengine.com/t/how-to-sync-controls-with-camera-in-rolling-ball-templete/109877/5 "2018-04-22T16:44:42Z")

</div>

That because my camera system was different from yours. In any case, this should work in your case, it’s just a question replacing one node:

 ![correct.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/f/6/5f6b8400307f790c774c26188be197e4f48a6329.png)

---

<div class="post-metadata">

**Author:** ![NUKETheWay](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nuketheway/32/489447_2.png) [@NUKETheWay](https://forums.unrealengine.com/u/NUKETheWay)\
**Post date:** [June 7, 2021, 1:10pm UTC](https://forums.unrealengine.com/t/how-to-sync-controls-with-camera-in-rolling-ball-templete/109877/6 "2021-06-07T13:10:01Z")

</div>

hello Thanks for this. But it does not work when viewing from top. I tried connecting z node and the ball just spins at same place instead of moving right of left. Please help!

---

<div class="post-metadata">

**Author:** ![NUKETheWay](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nuketheway/32/489447_2.png) [@NUKETheWay](https://forums.unrealengine.com/u/NUKETheWay)\
**Post date:** [June 9, 2021, 10:21am UTC](https://forums.unrealengine.com/t/how-to-sync-controls-with-camera-in-rolling-ball-templete/109877/7 "2021-06-09T10:21:02Z")

</div>

[https://answers.unrealengine.com/questions/1034329/physicsball-bp-camera-control-sync-how.html?childToView=1034552#answer-1034552](https://answers.unrealengine.com/questions/1034329/physicsball-bp-camera-control-sync-how.html?childToView=1034552#answer-1034552)

solution for this issue is here
