Aiming 2.0

This commit is contained in:
Marco 2025-06-26 17:00:49 +02:00
commit 8d2aab985e
6 changed files with 13 additions and 11 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

BIN
3D/BlockbenchModels/Tank/Tank_0.png (Stored with Git LFS)

Binary file not shown.

View file

@ -8,7 +8,7 @@ metadata={
"vram_texture": false
}
generator_parameters={
"md5": "44dcb73adaad1f0b8da599211f64c15c"
"md5": "9fe48a635fd9642b4d6d2aeb3d98c93b"
}
[deps]

View file

@ -233,7 +233,7 @@ pixel_size = 0.05
texture_filter = 0
sprite_frames = ExtResource("6_yq7h2")
animation = &"idle"
frame_progress = 0.755868
frame_progress = 0.316881
script = ExtResource("9_yarib")
[node name="Legs" type="AnimatedSprite3D" parent="AnimationProvider"]

View file

@ -85,7 +85,8 @@ public partial class KeyboardInputProvider : InputProvider
public override Vector2 GetAimInput()
{
Vector2 rightStickInput = GetRightStickInput();
// TODO: Make a solution that does not rotate in 2D
Vector2 rightStickInput = GetRightStickInput().Rotated(Mathf.DegToRad(-45f));
Vector2 mouseInput = GetMouseAimInput();
// Determine which input method to use
@ -103,10 +104,11 @@ public partial class KeyboardInputProvider : InputProvider
private Vector2 GetRightStickInput()
{
return new Vector2(
Input.GetAxis(LeftAimName, RightAimName),
Input.GetAxis(UpAimName, DownAimName)
);
return Input.GetVector(LeftAimName, RightAimName, UpAimName, DownAimName);
// return new Vector2(
// Input.GetAxis(LeftAimName, RightAimName),
// Input.GetAxis(UpAimName, DownAimName)
// );
}
private Vector2 GetMouseAimInput()