Simple FPS camera

by tavurth

59

Simple FPS camera

img img img img

Web Demo (3.x) ←←←←

https://github.com/tavurth/godot-simple-fps-camera/assets/100964/6ffa57d2-5390-4f63-a4f9-8c4c7b3cbed5

https://user-images.githubusercontent.com/100964/153240320-7fad22ed-8840-4f54-9ee1-8af7421e9767.mp4

A FPS camera made for the purposes of teaching others GDscript and godot.

The purpose of this demo is to show how to create a camera in a simple way. You are free to use, modify and merge this in whatever way you like.

Requirements:

For Godot 4.2 and higher, please see the "master" branch

Ideas

Camera rotation

The main idea I'd like to represent here is splitting the X rotation and Y rotation.

We use a parent node "Player", and a child node "Camera". The parent node takes care of the left and right rotation, while the child node takes care of vertical rotation.

If we simply try to rotate the child node in first the X and then the Y directions we'd end up with a sort of flight-simulator camera, where we can roll left and right rather than turning left and right.

Player model

The player model was loaded as a .glb file with animations. The animations were downloaded from mixamo.com.

Then an AnimationTree was created and you can explore the two AnimationBlend1D which are used for moving and strafing.

Version

1.0

Engine

3.4

Category

Demos

Download

Version1.0
Download

Support

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

Contact Author