[Tutorial] Multi touch controls, demo project

wombatstampedewombatstampede Posts: 41Member
edited June 2017 in Tutorials

I did a little demo about implementing multi touch controls in a godot project.

The demo itself is 3D physics based. You'll move a cube which floats above the ground. Movement,floating & turning is done via apply_impulse.

In the project you'll find scripts attached to various nodes which cover different topics:

World/gui/VertControl & World/gui/HorControl:
This is the input handling of the touch controls. For multi-touch it is important to watch the "index" of the event and monitor if the initial "touch" took place inside the control (coordinates are "global").

Reads the values produced by the touch controls and applies forces to the RigidBody accordingly via apply_impulse.

Shows a little "floating" algorithm which keeps the body in the "air". (includes damping)
Floating is done via applying forces (apply_impulse) to the 4 corners of the body depending on how deep that area is "under water".

A little code to let the camera always be above and behind the RigidBody.

This demo was successfully tested on android. (Don't have multitouch on my PC)
But you can still use it with a mouse.


Tags :


  • martymarty Posts: 82Member

    This project seem really cool and I'd love to check it out but the ZIP files doesn't contain a project file and the single scene file is corrupt. Any chance you can re-upload it? TIA!

Sign In or Register to comment.