Cinematic Camera 2D

An asset by HexagonNico
The page banner background of a mountain and forest
Cinematic Camera 2D thumbnail image
Cinematic Camera 2D thumbnail image
Cinematic Camera 2D thumbnail image
Cinematic Camera 2D hero image

Quick Information

0 ratings
Cinematic Camera 2D icon image
HexagonNico
Cinematic Camera 2D

Adds a 2D cinematic camera that can be used to create smooth transitions between cameras.The plugin contains two scripts: virtual_camera_2d.gd and cinematic_camera_2d.gd. Both can be added to your scenes as nodes through the "Create New Node" menu.

Supported Engine Version
4.0
Version String
2.1.1
License Version
MIT
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

Cinematic Camera 2D

Cinematic Camera 2D is a plugin that adds a 2D cinematic camera that can be used to create smooth transitions between cameras.

This repository contains the plugin files and a demo that shows the usage of the plugin.

This is the Godot 4 version of the plugin. You can find the version for Godot 3 here

Support

Cinematic Camera 2D was developed by HexagonNico. Please consider supporting the project with a donation if you like this plugin!

README ko-fi

Consider also trying my games: hexagonnico.itch.io

Plugin contents

The plugin contains two scripts: virtual_camera_2d.gd and cinematic_camera_2d.gd. Both can be added to your scenes as nodes through the "Create New Node" menu.

The VirtualCamera2D node is a virtual camera. It controls the movement of a camera and its settings.

The CinematicCamera2D node is the camera itself. It extends the Camera2D node and needs a reference to a VirtualCamera2D node that can be assigned to it through the inspector or with a script.

README Create node

Creating a camera

Open the "Create New Node" menu and search for "CinematicCamera2D". You will see that this node has one more property than the basic camera, that is a node path to a VirtualCamera2D node.

README Cinematic camera

Open the "Create New Node" menu again and this time look for a "VirtualCamera2D". This node contains all the properties that are used by a cinematic camera.

Now go back to the CinematicCamera2D node and set the 'Virtual Camera' property to the VirtualCamera2D node you just added.

README Virtual camera

If you modify the properties of the VirtualCamera2D node, you will see that you camera will now smoothly transition to these values, even while in the editor.

Following the player

The cinematic camera mainly does two things for you: updating the camera properties and following another node.

If you want your cinematic camera to follow the player, go to the VirtualCamera2D node and set the 'Follow Node' property to your player node.

Note that the camera won't move while in the editor, but only while the game is running.

Transitioning between cameras

The true strength of the Cinematic Camera 2D plugin is the ability to create smooth transitions between cameras.

Add another VirtualCamera2D node to your scene and try changing some of its properties like the 'Zoom' or the 'Offset' values.

Now, if you change the 'Virtual Camera' property in your CinematicCamera2D node, you will see that the camera is now using the values of the other VirtualCamera2D node.

The value of 'Virtual Camera' can also by updated from scripts to create transitions between the two cameras.

@export var virtual_camera: NodePath

func _ready() -> void:
    cinematic_camera.virtual_camera = get_node(virtual_camera)

Try adding the following script to your scene's root:

extends Node2D

@onready var camera: CinematicCamera2D = $CinematicCamera2D

@onready var virtual_camera_1: VirtualCamera2D = $VirtualCamera2D
@onready var virtual_camera_2: VirtualCamera2D = $VirtualCamera2D2

func _input(event: InputEvent) -> void:
    if event is InputEventKey and event.is_pressed():
        if event.scancode == KEY_1:
            camera.virtual_camera = virtual_camera_1
        elif event.scancode == KEY_2:
            camera.virtual_camera = virtual_camera_2

This script will change between the two cameras every time you press the '1' and '2' buttons.

Contributing

Cinematic Camera 2D is open to contribution. If you want to contribute with a new kind of property or a new feature, please consider also contributing to the documentation.

Adds a 2D cinematic camera that can be used to create smooth transitions between cameras.

The plugin contains two scripts: virtual_camera_2d.gd and cinematic_camera_2d.gd. Both can be added to your scenes as nodes through the "Create New Node" menu.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Cinematic Camera 2D icon image
HexagonNico
Cinematic Camera 2D

Adds a 2D cinematic camera that can be used to create smooth transitions between cameras.The plugin contains two scripts: virtual_camera_2d.gd and cinematic_camera_2d.gd. Both can be added to your scenes as nodes through the "Create New Node" menu.

Supported Engine Version
4.0
Version String
2.1.1
License Version
MIT
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers