mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-09 18:15:55 +00:00
Rewritten camera to follow cursor
This commit is contained in:
parent
2bfc35d48c
commit
869a3b4c06
7 changed files with 232 additions and 9 deletions
16
Scripts/Misc/CameraTarget.cs
Normal file
16
Scripts/Misc/CameraTarget.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Misc;
|
||||
|
||||
public partial class CameraTarget : Node2D
|
||||
{
|
||||
public override void _Ready()
|
||||
{
|
||||
// register with the controller
|
||||
var res = GetTree().GetFirstNodeInGroup("camera_controllers");
|
||||
if (res is not null && res is CameraController cameraController)
|
||||
{
|
||||
cameraController.RegisterTarget(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue