A downloadable asset pack

Download NowName your own price

EcFlyCamGD is a "fly-through camera" controller for the Godot Engine developed and tested in version 4.3-stable. Move forward, backward, up, down, left, right, and choose to go fast or slow. Navigate and observe a scene similar to you could in Minecraft's spectator mode.


GitHub repository: EcSolticia/EcFlyCamGD on GitHub

The file available for download here is that from the git commit with full SHA "7311d73dac7ab941ca71d00f762f3fc0b145c37e". If it is succeeded by newer commits without any updates here, the FlyCam folder found in the repository might not be stable.

The downloadable file here features only a .zip file containing the Godot scene (.tscn file) for the camera controller and the pertinent scripts (.gd). The zip file contains a folder named "FlyCam" containing exactly the following files:

  • fly_cam_controller.tscn: The said scene.
  • fly_cam_controller.gd: The main script for the scene.
  • cam.gd: The script for the actual Camera3D node in Godot.

Further, the scene itself exhibits the following tree structure within the engine

  • FlyCamController (Type: CharacterBody3D)
    • Cam (Type: Camera3D)
    • CollisionShape3D* (Type: CollisionShape3D)
      • MeshInstance3D* (Type: MeshInstance3D)

By default, the CollisionShape3D is disabled and the MeshInstance3D is made invisible as fly_cam_controller.gd executes _onready()

The FlyCamController exhibits the following export variables, those in fly_cam_controller.gd which can be set from the editor:

  • "forward" and "right" (Vector3): Basis vectors collectively determining how different axes of movement relate to each other, and individually determining the direction of "forward" or "rightward movement" in global coordinates, respectively.
  • "movement_sensitivity" (float): Synonymous with "movement speed factor"
  • "speed_up_scale" (float): The factor by which "movement_sensitivity" is effectively multiplied when the key mapped to the "Speed Up" action is pressed and held. Is meant to be greater than 1 by default to align with the intuition of "speeding up", and specifically "up" - but can be less than 1, 0, and even negative.
  • "mouse_sensitivity" (float).
  • "mouse_captured" (bool): If "true", set the mouse mode to captured. Otherwise, set it to visible.
  • "mesh_used" (Mesh): The mesh for the pertinent MeshInstance3D object.
  • "mesh_visible_in_game" (bool): Determines whether the mesh is visible in-game.
  • "collision_shape_used" (Shape3D): The shape used by the CollisionShape3D node. Is consequential by default
If you notice any errors in my code or other improvements which can be made, you are free to create a pull request on GitHub. If you cannot fix those errors yourself, or simply do not want to do it, you are free to create an issue on GitHub, make a comment here, or e-mail me at quinnecsolticia@gmail.com.


Setup

Loading the Scene and GDscript Code into your Project

1. Download the .zip file.

2. Open your Godot project directory

3. Extract the "FlyCam" folder in "FlyCam.zip" to any location on the directory

Configuring the FlyCamController

1. Go to Projects > Project Settings > Input Maps in the Godot editor.

2. Add the following list of action strings, and your preferred keys for the respective actions:

  • "Forward": Moves the Camera forward in space.
  • "Backward": Inverse of "Forward"
  • "Right": Moves the Camera to the relative right in the x-y plane.
  • "Left": Inverse of "Right"
  • "Up": Moves the Camera up in the y axis.
  • "Down": Inverse of "Up"
  • "Speed Up": Increases the speed of motion when held.
  • "Toggle Mouse Capture": Toggles the mouse mode between captured and visible.

Without these specific actions configured, the debugger will constantly present errors. 3. Instantiate the "FlyCamController" scene in the scene you wish the Camera to be active. Done.

Published 26 days ago
StatusReleased
CategoryAssets
AuthorEcSolticia
TagsGodot, sourcecode

Download

Download NowName your own price

Click download now to get access to the following files:

FlyCam.zip 1.8 kB

Leave a comment

Log in with itch.io to leave a comment.