A player Flying Kit for Unity

vcard's picture

Hi all,

As posted before in BabelX3d forum:

Avatars that fly are important for Virtual World creators and users but Unity, out of the box, only provides walking avatar scripts and prefabs.  With fly we can explore and enjoy virtual worlds in so many ways that a mere walking avatar is unable to provide. So, we have been working on a basic Fly Mode Kit to complement Unity's third person controller and add flying to your virtual world projects. 

BabelXplayerFlyKit is out now. Download it from our UnityPackages public folder and install the usual way on your unity project.


BabelXplayerFlyKit includes 3 core functionalities: flying, camera rotator and camera zoom. Although in different degrees of implementation, these features are common in classical virtual world systems (OpenSim, VRML/X3D, ...).and users/creators appreciate them. 

In BabelXplayerFlyKit the features are implemented in three core scripts that work independently:

  • PlayerFlyControlScriptX.cs - the core script for flying mode (Tip: if you configure the Water field of the script it will kinda "fly" on water too)
  • MouseRotatorRightButtonX.cs - Implements a camera rotator with mouse right click in order to leave left click free for other more common features .
  • and MouseScrollWheelX.cs- This implements a zoom that is also a practical way for creators to have the benefits from both, first person view and third person, without the hassle of implementing two different navigation views in a scene.

Since these scripts work independently, their features can be used simultaneously or not by enabling or disabling the correspondent script. Example: if you want flying but do not like mouse rotator simply disable (or remove) MouseRotatorRightButtonX.cs and vice-versa.

Installation and Use

Adding a fly feature to your project is extremely simplified with the use of prefabs. After downloading and installing the kit package, a “BabelXplayerFlyKit” folder appears under Assets in unity’s project window. Then,

  1. disable the camera you had previously in your scene (the kit includes its own camera and you shouldn't have two active in a scene),
  2. drag the included prefabs ThirdPersonControllerX and MultipurposeCameraRigX, available in the kit prefabs subfolder, to  Unity's Hierarchy window  and ... you're done.
  3. Since the avatar & camera are in position (0, 0, 0) you can, obviously, reposition them to another coordinates entry point. 

Kit use


Some effort has been put here in order to have, as much as possible, "standard keys and controls" (arrows, wasd, ...) used in Opensim and other virtual world systems.


Demos & support

A scene demo is included in the kit to test features and check configuration details. Get more detailed installation and using details in BabelXplayerFlyKit  - quick start tutorial, included in the kit and also available in our packages public folder.

Other demos, support and more on the forum: http://portal.babelx3d.net/content/flying-avatars-unity


Include flying in your 3D worlds and enjoy them in a new way!