dlnk Top Down Library

When creating environments for an unknown game it comes the labor of making it usable for several kind of games. All assets here at Dlnk are intended to be mixed in different situations. In the case of Top Down games this tool allows you to hide and show the different floors of your level using a top down camera or swich to fps / third person camera anytime in playmode.


This script library has been designed to test top down with environment scenes. It controls player and buildings over different height levels / floors. Also include features for optimization and active objects such as doors or chests.


  • Global/Local detail optimization
  • Handheld / Top Down camera control
  • Basic interface control
  • Floor level control
  • Active elements (utilizable props)

Tips & notes

  • This script library is meant to be mixed with ThirdPersonController, Standard Assets: Cameras, CrossPlatformImput, & Effects to create playable scenes.
  • You are allowed to use it commercially but not to resell the scripts or parts of them.
  • This is a freebie and no support is granted.


This documentation is made for the legacy system of TopDown control scripts. It has no support and it's no longer included in new assets. Althought it will keep working (probably) for many time... So it's free! Use it at your own risk ;)

Inside the library


There are three main scripts: [SceneControl.cs] that cares about the scene details, wich contains control over player, cameras and the top down sytem. [TownManager.cs] to manage the different buildings / zones in your scene and optimization options. And finally [BuildingControl.cs] where all individual floor from one building or zone is stored with it's related info.


Finally, there are some additional scripts are required for the system to improve usability for environments:

[BuildingTrigger.cs] Wich must be placed in colliders to limit the floor-changing zones

[Push Trigger.cs] Useful to make utilizable props.

[AnimateGOTrigger.cs] This script is used to make an object animate when you are in trigger (with or without pressing key)

[ActivateGO.cs] This scripts works for enable or unable several gameobjects from a trigger with keycode

[SetMaterialGO.cs] Using this you can switch from 2 materials pressing keycode from a trigger in one or several gameobjects

Core Scripts

Scene Control

Sun Light Links with the light used as sun.

Sky Background Links with the background material.

Background Music Link here the music source.

FXs Link here your FXs main game object.

Enable Fx Keycode for switch effects on/off.
Town Links with the [TownControl] object in scene.

Player Character Links the collider of the player character.
FPS Camera Links with non-cenital camera (enabled occlussion culling).
Top Down Camera Links with top-down camera (disabled occlussion culling).
Camera Switch Key Select key to switch between FPS and TopDown cameras in play.
Help Key Key for quick help GUI (show/hide in playmode).
Deco Cheap Key for switch "Cheap Decoration" boolean in playmode when "Override Local Sett" is checked at [Town Manager].
Door Key Defines key for active elements (Doors, chests, etc.) If pressed when character is in a [PushTrigger] collider it activates.
Location GUI Links with the related GUI text in scene.
Camera GUI Links with the related GUI text in scene.
Help text Links with the related GUI text in scene.Vol Slider Links with the related GUI slider in scene for music volume control.Sun Rotation Links with the related GUI slider in scene for Sun Light rotation.

Sun Intensity Links with the related GUI slider in scene for Sun Light intensity.My Cursor Defines custom cursor image.Hot Spot Defines hotspot for custom cursor.

Town Manager

Enable Town Control The script is active while checked

Cheap Decoration All decoration objects are unabled while the player is not in this floor or building/zone.

Override Local Settings It enables the previous option wich override settings from each building.

Buildings size Number of buildings/zones in your town.

Building Target Contains the Building Control from one building/zone. All buildings in scene must be stored here. (only one Town Manager in scene)

Cheap Decoration Local settings for cheap decoration option. Only works when "Override Local Settings" is unchecked.

Building Control

Building Name Defines the name of the building.

Cheap Decoration Enables "Cheap Decoration" option for this building. Can be also changed at [TownManager].

Floors size Defines the number of vertical floors in the building.

Floor Name Defines the name of the floor level.

Target Go Links the gameobject that contains the floor level.

Floor Num Defines the floor layer with a number from the basement to the top.

All Floors Decoration objects in this floor level bypass the "cheap decoration" and keep visible when the character is in any upper level or out of the building.

Props Group Links the gambeobject that contains al decoration props in the actual floor level.

Ceiling Shadow Links the game object that contains the shadow projectors for the actual floor level. Ground Level (Floor Num = 0) never uses "Ceiling Shadow".

Additional Scripts

Building Trigger

Building  Links the [BuildingControl] for the building where it's located.

Floor Level Defines the actual floor level.

Target Floor Defines the new floor level.

Dynamic (not recommended) Enables dynamic triggers (automatic floor).

Floor Movement (using Dynamic) Set the movement of the stairs/door to move up or down between different floor levels.


Push Trigger

Manager Script Links with [TownManager] in scene.

Door Hingle Links to the target transform.

Opened Initial position is action completed. Starts backwards when activated.

Percentage Defines the percentage of the action that will be completed.

Auto Behaviour will be executed whenever player hits trigger.

XYZ Displacement Defines the total translation for "Door Hingle"

Rotation Defines the quaterion for "Door Hingle" total rotation.

Duration Defines the time (in seconds) for the action to complete.


animate go Trigger

Manager Script Links with [TownManager] in scene.

Go Target Links to the target transform (must have with Animator Controller).

Locked It makes animation not able to reproduce

Auto Anim If enabled animation starts whenever player enters trigger (No keycode)


activate go

Manager Script Links with [TownManager] in scene.

Target GO Sets one or several gameobjects to be affected with the script

G on Trigger It enables a gameobject only while player is in trigger (optional)

Override Scene Sets the original state (enable/unable) for the Target GOEnable It sets Target GO enabled/unabled

set material go

Manager Script Links with [TownManager] in scene.

Switch GO Sets one or several gameobjects to be affected with the script

Original Material Set original material

Switched Material Set material to switch

Enable Switch Sets the switched material in the Switch GO rather than original