mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-11 15:35:54 +00:00
2D Character and weapons
This commit is contained in:
parent
072f6d0ce6
commit
cc9c4e5aa1
37 changed files with 1115 additions and 91 deletions
16
Scripts/Components/Actors/MouseAimProvider3D.cs
Normal file
16
Scripts/Components/Actors/MouseAimProvider3D.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using Cirno.Scripts.Misc;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.Actors;
|
||||
|
||||
public partial class MouseAimProvider3D : Node3D, IMouseAimProvider
|
||||
{
|
||||
public Vector2 GetMouseAimInput()
|
||||
{
|
||||
Vector2 mouseWorldPos = DisplayServer.MouseGetPosition();
|
||||
|
||||
var screenPosition = CameraController3D.Instance.UnprojectPosition(this.GlobalPosition);
|
||||
|
||||
return mouseWorldPos - screenPosition;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue