Simple Free-Look Camera for Godot 4 in C#

by D0ct0rDave

3

Simple Free-Look Camera

A C# implementation of the SimpleFreeLookCamera found in the AssetStore:

Original description:

A simple 3D free-look camera for Godot 4.0 that mimics the functionality of the editor's camera for in-game use.

Ported from Richardhyy's Godot 4.0 version,
who ported from Adamviola's Godot 3.2 version.

Why should you use the C# version?

Installation

Attach FreeLookCameraBase.cs or FreeLookCamera.cs to your Camera3D node. That's it!

  • Attaching FreeLookCameraBase behaves exactly like the original GD script version.

  • If you attach FreeLookCamera.cs instead, you'll be able to switch from your current game camera's to the free one, just setting the Enabled property of it. For instance by handling an input action from your script:

...
if (Input.IsActionJustReleased("ToggleFreeCameraAction"))
{
    _freeCameraNode.Enabled = !_freeCameraNode.Enabled;
}
...

Usage

Use W and S to move forward and backward.

Use A and D to move left and right.

Use Q and E to move up and down.

Roll the scroll wheel to increase and decrease movement speed.

Press shift to move faster, and hold alt to move slower.

Hold down the right mouse button to rotate the camera.
There's a slider in the editor to control mouse sensitivity.

License

MIT.

Version

1.0

Engine

4.2

Category

Scripts

Download

Version1.0
Download Now

Support

If you need help or have questions about this plugin, please contact the author.

Contact Author