# How to 3rd person ball controller that can look up and down?

**URL:** <https://blenderartists.org/t/how-to-3rd-person-ball-controller-that-can-look-up-and-down/1440546>\
**Category:** Game Engine Support and Discussion\
**Tags:** upbge\
**Created:** [December 28, 2022, 2:06am UTC](https://blenderartists.org/t/how-to-3rd-person-ball-controller-that-can-look-up-and-down/1440546 "2022-12-28T02:06:21Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![musikai](https://blenderartists.org/user_avatar/blenderartists.org/musikai/32/1395660_2.png) [@musikai](https://blenderartists.org/u/musikai)\
**Post date:** [December 28, 2022, 11:31pm UTC](https://blenderartists.org/t/how-to-3rd-person-ball-controller-that-can-look-up-and-down/1440546/6 "2022-12-28T23:31:41Z")

</div>

Don’t put the script between the mouse sensor and the actuator, connetct these directly.  
Use an always sensor for the script.

Wow, the example game was a lot of effort! I looked if it was useful to excerpt his setup for UPBGE but found out it is even more complicated than my own solution.

> [@Marble and Ball](https://blenderartists.org/t/marble-and-ball/1380121):
>
> UPBGE 0.3 Hello, long live Blender and UPBGE!!! “Marble and Ball” is a 2 Player game which can be played by 2 persons or (if you are musician slight_smile ) with both hands of 1 person. Ball is controlled with WASD (or Gamepad), Marble with the mouse (or Gamepad 2). Together they have to finish 12 little levels and 4 Bonus levels (which are the first 4 original Marble Madness levels). This game is a tribute to the original Marble Madness which as a kid I played endlessly on an arcade mac…

You surely want to your controls relative to the camera view and not bound to world coordinates.

So I made a new empty file and appended only the ball and camera system and stripped off everything else from the scene and the scripts.  
(This setup uses 2 empties for the camera. It would also work with only 1 empty but this way you have more control of smooth camera Motion / Rotation)  
The camera system is in collection that is set to non-selectable, change this in case you want to edit it.

```auto
Ball:   
    W A S D move
    SPACE jump
View:
    Mouse or Arrow-Keys: Rotate view
    Mousewheel or Page-up/Page-down: Zoom
    Middle Mousebutton or Home: Reset Zoom
    F: Camera Follows Ball On/Off

Ball has 2 game properties
'Mouse_sensitivity':
    Camera speed
'Keyboard_sensitivity':
    Ball Speed

Objects with property "obstacle" will let the camera go beyond. (also the floor has this)
Objects with property "transparent" and suitable Material will go transparent when view is blocked.

```

[UPBGE\_0.3\_Ball.blend](https://blenderartists.org/uploads/short-url/61DTaPirWunXJpSZiYPbjYhh9Ya.blend) (1.1 MB)

---

_[View the full topic](https://blenderartists.org/t/how-to-3rd-person-ball-controller-that-can-look-up-and-down/1440546)._
