From f84e8cfe5a2c10205ed16a0ebaff6841fbccbb6b Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 9 Jul 2025 14:46:16 -0400 Subject: [PATCH] added: initial input handling for grapple --- Assets/Player/Input/PlayerInputs.inputactions | 31 +++++++++++++++++++ Assets/Scripts/Player/PlayerControls.cs | 8 +++++ 2 files changed, 39 insertions(+) diff --git a/Assets/Player/Input/PlayerInputs.inputactions b/Assets/Player/Input/PlayerInputs.inputactions index 6962ce8..8c5c91a 100644 --- a/Assets/Player/Input/PlayerInputs.inputactions +++ b/Assets/Player/Input/PlayerInputs.inputactions @@ -58,6 +58,15 @@ "processors": "", "interactions": "", "initialStateCheck": false + }, + { + "name": "Grapple", + "type": "Button", + "id": "00393a1c-cfdb-46f8-8e02-552382b53236", + "expectedControlType": "", + "processors": "", + "interactions": "", + "initialStateCheck": false } ], "bindings": [ @@ -236,6 +245,28 @@ "action": "Cancel Lock-On", "isComposite": false, "isPartOfComposite": false + }, + { + "name": "", + "id": "62c22ef2-a01a-4fce-a688-9eb5fd35b9bc", + "path": "", + "interactions": "", + "processors": "", + "groups": "", + "action": "Grapple", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "3c93b098-1bd2-42c6-90d6-3eea7694acd0", + "path": "/rightTrigger", + "interactions": "", + "processors": "", + "groups": ";Controller", + "action": "Grapple", + "isComposite": false, + "isPartOfComposite": false } ] } diff --git a/Assets/Scripts/Player/PlayerControls.cs b/Assets/Scripts/Player/PlayerControls.cs index d6690cb..881327f 100644 --- a/Assets/Scripts/Player/PlayerControls.cs +++ b/Assets/Scripts/Player/PlayerControls.cs @@ -48,6 +48,14 @@ public class PlayerControls : MonoBehaviour{ public void OnCancelLockOn(){ GetComponent().RemoveLockOnTarget(); graph.SendEvent("InputEvent", "CancelLockOn", null); + } + public void OnGrapple(InputInteractionContext context){ + if (context.control.IsPressed()) { + graph.SendEvent("InputEvent", "GrappleDown", null); + } else { + graph.SendEvent("InputEvent", "GrappleUp", null); + } + } }