Material Box

Material Box

WEB Design & Material Images

Godot - Make camera follow player

Godot

Code example to make camera follow player in GDScript.


Create a new camera with Camera2D.new().
By using add_child() to place it as a child node of the player, the camera will follow its parent node.

To make the camera follow the player, position the camera node in the player node.

var camera = Camera2D.new()

func _ready():
	add_child(camera)

Godot

TitleGodot - Make camera follow player

CategoryGodot

Created

Update

AuthorYousuke.U