Navigation handles user input (key presses, mouse movement, touches on mobile devices, …​) to move the camera.

You can assing any instance of TCastleNavigation class to TCastleViewport.Navigation. As TCastleNavigation class is abstract, you actually have to use some descendant of it, like:

You have complete freedom how do you handle the input in your games. You can

  • use one of our ready navigation classes listed above,

  • or implement a new descendant of TCastleNavigation,

  • or leave TCastleViewport.Navigation as nil and handle the navigation elsewhere. For example, move the camera in response to user input in your TStatePlay.Update.

See the Tutorial: Designing a 3D world and Tutorial: Designing a 2D world to see the typical workflow how do you manipulate the navigation using the editor.

To improve this documentation just edit the source of this page in AsciiDoctor (simple wiki-like syntax) and create a pull request to Castle Game Engine WWW (cge-www) repository.