From f87c5a2cb7bf14f6357b158e4a257153491e80fc Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 31 Aug 2025 11:58:10 -0400 Subject: [PATCH] change: number tweaks to grapple, some cleanup --- .../Graphs/PlayerMovementResetTriggerBT.asset | 4 +- Assets/Scenes/GrappleTesting.unity | 52 ++++++++++--------- Assets/Scripts/Player/UnitMovementHandler.cs | 36 ++++++------- 3 files changed, 47 insertions(+), 45 deletions(-) diff --git a/Assets/Player/Graphs/PlayerMovementResetTriggerBT.asset b/Assets/Player/Graphs/PlayerMovementResetTriggerBT.asset index e20330e..1b65d38 100644 --- a/Assets/Player/Graphs/PlayerMovementResetTriggerBT.asset +++ b/Assets/Player/Graphs/PlayerMovementResetTriggerBT.asset @@ -20,13 +20,13 @@ MonoBehaviour: Air Movement"},"eventValue":{"_value":1.0},"delay":{},"$type":"NodeCanvas.Tasks.Actions.SendEvent`1[[System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},"_position":{"x":571.0,"y":1106.0},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"7"},{"_condition":{"eventName":{"_value":"Air Reset Received"},"$type":"NodeCanvas.Tasks.Conditions.CheckEvent"},"_position":{"x":824.0,"y":1105.0},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"8"},{"_condition":{"eventName":{"_value":"Cancel - Air Movement Reset"},"$type":"NodeCanvas.Tasks.Conditions.CheckEvent"},"_position":{"x":955.4977,"y":598.6238},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"9"}],"connections":[{"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"2"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"3"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"9"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"3"},"_targetNode":{"$ref":"4"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"4"},"_targetNode":{"$ref":"5"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"5"},"_targetNode":{"$ref":"6"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"6"},"_targetNode":{"$ref":"7"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"6"},"_targetNode":{"$ref":"8"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"}],"canvasGroups":[],"localBlackboard":{"_variables":{}},"derivedData":{"repeat":true,"$type":"NodeCanvas.BehaviourTrees.BehaviourTree+DerivedSerializationData"}}' + Air Movement Reset"},"$type":"NodeCanvas.Tasks.Conditions.CheckEvent"},"_position":{"x":955.4977,"y":595.6238},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"9"}],"connections":[{"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"2"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"3"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"9"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"3"},"_targetNode":{"$ref":"4"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"4"},"_targetNode":{"$ref":"5"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"5"},"_targetNode":{"$ref":"6"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"6"},"_targetNode":{"$ref":"7"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"6"},"_targetNode":{"$ref":"8"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"}],"canvasGroups":[],"localBlackboard":{"_variables":{}},"derivedData":{"repeat":true,"$type":"NodeCanvas.BehaviourTrees.BehaviourTree+DerivedSerializationData"}}' _objectReferences: [] _graphSource: _version: 3.31 _category: _comments: - _translation: {x: 92, y: 23} + _translation: {x: 216, y: -78} _zoomFactor: 1 _haltSerialization: 0 _externalSerializationFile: {fileID: 0} diff --git a/Assets/Scenes/GrappleTesting.unity b/Assets/Scenes/GrappleTesting.unity index 91f6156..42b1fec 100644 --- a/Assets/Scenes/GrappleTesting.unity +++ b/Assets/Scenes/GrappleTesting.unity @@ -99485,7 +99485,7 @@ MonoBehaviour: Change Smoothing","value":{}},"rotationSpeed":{"label":"Rotation Speed","value":{}},"rotationSmoothing":{"label":"Rotation Smoothing","value":{},"changeValue":2},"rotationInputBlending":{"label":"Rotation Input Blending","value":{}},"feedNewRotation":{},"feedRelativeTo":{},"$type":"Reset.Core.ChangeMovementSettings"},{"valueA":{"_name":"newAirMoveSmoothing","_targetVariableID":"9ba7a222-e29f-4ef5-8f1e-144189e5e5d3"},"valueB":{"_value":1.0},"_isDisabled":true,"$type":"NodeCanvas.Tasks.Actions.SetFloat"},{"eventName":{"_value":"Air - Reset Received"},"delay":{},"_isDisabled":true,"$type":"NodeCanvas.Tasks.Actions.SendEvent"}]},"_color":{"r":0.3647059,"g":0.3215686,"b":1.0,"a":1.0},"_name":"Airborne + Reset Received"},"delay":{},"$type":"NodeCanvas.Tasks.Actions.SendEvent"}]},"_color":{"r":0.3647059,"g":0.3215686,"b":1.0,"a":1.0},"_name":"Airborne Standard Movement","_position":{"x":816.2676,"y":-364.6197},"$type":"NodeCanvas.StateMachines.ActionState","$id":"2"},{"_onEnterList":{"executionMode":1,"actions":[]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"foldUpdate":true,"_color":{"r":0.4980392,"g":1.0,"b":0.9803922,"a":1.0},"_name":"Airborn (Standby)","_position":{"x":630.0591,"y":-108.6804},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"3"},{"_actionList":{"executionMode":1,"actions":[{"raycastHit":{"_name":"_wallJumpHit"},"transform":{},"collider":{},"gameObject":{},"distance":{},"normal":{"_name":"_wallJumpHitNormal"},"point":{},"$type":"NodeCanvas.Tasks.Actions.DecomposeRaycastHit"}]},"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_name":"Left Side Wall Jump","_position":{"x":309.8118,"y":-282.4449},"$type":"NodeCanvas.StateMachines.ActionState","$id":"4"},{"_onEnterList":{"executionMode":1,"actions":[{"moveSpeed":{"label":"Move @@ -99500,31 +99500,33 @@ MonoBehaviour: Direction","newValue":{"$content":4,"$type":"PlayerFacingDirection"},"changeValue":1},"rotationSpeed":{"label":"Rotation Speed","value":{}},"rotationSmoothing":{"label":"Rotation Smoothing","value":{}},"rotationInputBlending":{"label":"Rotation Input Blending","value":{}},"feedNewRotation":{},"feedRelativeTo":{},"$type":"Reset.Core.ChangeMovementSettings"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[{"valueA":{"_name":"airJumpsRemaining","_targetVariableID":"23f0ddc0-c4e8-462f-a7e0-fdd8e818d08d"},"Operation":2,"valueB":{"_value":1},"$type":"NodeCanvas.Tasks.Actions.SetInt"}]},"foldEnter":true,"foldExit":true,"_color":{"r":0.4132327,"g":0.945098,"b":0.254902,"a":1.0},"_name":"Left - Side Wall Jump","_position":{"x":72.76006,"y":-425.8029},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"5"},{"_onEnterList":{"executionMode":1,"actions":[]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"foldUpdate":true,"_color":{"r":0.5019608,"g":1.0,"b":0.9803922,"a":1.0},"_name":"Airborn - (Locked)","_position":{"x":-18.14897,"y":459.9319},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"6"},{"_position":{"x":-169.0027,"y":131.3442},"$type":"NodeCanvas.StateMachines.EmptyState","$id":"7"},{"_onEnterList":{"executionMode":1,"actions":[{"moveSpeed":{"label":"Move + Side Wall Jump","_position":{"x":94.22898,"y":-440.666},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"5"},{"_onEnterList":{"executionMode":1,"actions":[]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"foldUpdate":true,"_color":{"r":0.5019608,"g":1.0,"b":0.9803922,"a":1.0},"_name":"Airborn + (Locked)","_position":{"x":-48.70015,"y":468.1573},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"6"},{"_position":{"x":-169.0027,"y":131.3442},"$type":"NodeCanvas.StateMachines.EmptyState","$id":"7"},{"_onEnterList":{"executionMode":1,"actions":[{"moveSpeed":{"label":"Move Speed","value":{},"changeValue":1},"moveSpeedSoothing":{"label":"Move Speed Smoothing","value":{},"changeValue":1},"airDirectionDecay":{"label":"Air Direction Decay","value":{},"changeValue":2},"accelerationSmoothing":{"label":"Acceleration - Smoothing","value":{"_value":1.0},"changeValue":1},"deaccelerationSmoothing":{"label":"Deacceleration - Smoothing","value":{"_value":1.0},"changeValue":1},"jumpPower":{"label":"Jump - Power","value":{}},"jumpPowerDecay":{"label":"Jump Decay Speed","value":{}},"gravityPower":{"label":"Gravity - Power","value":{},"changeValue":1},"gravityMax":{"label":"Gravity Max","value":{},"changeValue":1},"gravityAcceleration":{"label":"Gravity - Acceleration Speed","value":{},"changeValue":1},"gravityScale":{"label":"Gravity - Scale","value":{}},"settingsChangeSmoothing":{"label":"Settings Change Smoothing","value":{}},"rotationSpeed":{"label":"Rotation + Smoothing","value":{},"changeValue":1},"deaccelerationSmoothing":{"label":"Deacceleration + Smoothing","value":{},"changeValue":1},"jumpPower":{"label":"Jump Power","value":{}},"jumpPowerDecay":{"label":"Jump + Decay Speed","value":{}},"gravityPower":{"label":"Gravity Power","value":{},"changeValue":1},"gravityMax":{"label":"Gravity + Max","value":{},"changeValue":1},"gravityAcceleration":{"label":"Gravity Acceleration + Speed","value":{},"changeValue":1},"gravityScale":{"label":"Gravity Scale","value":{}},"settingsChangeSmoothing":{"label":"Settings + Change Smoothing","value":{"_value":4.0},"changeValue":1},"rotationSpeed":{"label":"Rotation Speed","value":{}},"rotationSmoothing":{"label":"Rotation Smoothing","value":{}},"rotationInputBlending":{"label":"Rotation - Input Blending","value":{}},"feedNewRotation":{},"feedRelativeTo":{},"$type":"Reset.Core.ChangeMovementSettings"},{"airDirection":{"_name":"airMoveDirection","_targetVariableID":"2fc91db6-09dd-4a1f-9195-426a0c44de31"},"jumpPower":{"_name":"jumpPower","_targetVariableID":"9a82efee-e317-423c-ad6e-5ef7e6145396"},"targetLocation":{"_name":"_grappleLaunchDir"},"offset":{"_value":{"y":1.0}},"relativeRotation":{},"launchRelativeTo":{},"useRelativeForce":{"_value":true},"minimumForce":{},"maximumForce":{"_value":100.0},"forceRelativeToDistance":{"_value":4.0},"force":{},"_isDisabled":true,"$type":"NodeCanvas.Tasks.Actions.StartLaunchJump"},{"grapplePoint":{"_name":"_grappleLaunchDir"},"speed":40.0,"horizontalDotBreak":-0.6,"verticalDotBreak":-0.2,"$type":"NodeCanvas.Tasks.Actions.DoGrapplePull"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"foldUpdate":true,"foldExit":true,"_color":{"r":0.5019608,"g":1.0,"b":0.9803922,"a":1.0},"_name":"Grapple","_position":{"x":-577.6198,"y":-223.454},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"8"},{"_onEnterList":{"executionMode":1,"actions":[]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[{"valueA":{"_name":"airJumpsRemaining","_targetVariableID":"23f0ddc0-c4e8-462f-a7e0-fdd8e818d08d"},"Operation":2,"valueB":{"_value":1},"$type":"NodeCanvas.Tasks.Actions.SetInt"}]},"foldEnter":true,"foldExit":true,"_color":{"r":0.4132327,"g":0.945098,"b":0.254902,"a":1.0},"_name":"Post - Grapple Jump","_position":{"x":-343.0,"y":-614.0},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"9"},{"_actionList":{"actions":[{"moveSpeed":{"label":"Move - Speed","value":{}},"moveSpeedSoothing":{"label":"Move Speed Smoothing","value":{}},"airDirectionDecay":{"label":"Air - Direction Decay","value":{}},"accelerationSmoothing":{"label":"Acceleration Smoothing","value":{"_value":0.1},"changeValue":1},"deaccelerationSmoothing":{"label":"Deacceleration - Smoothing","value":{"_value":0.1},"changeValue":1},"jumpPower":{"label":"Jump + Input Blending","value":{}},"feedNewRotation":{},"feedRelativeTo":{},"$type":"Reset.Core.ChangeMovementSettings"},{"airDirection":{"_name":"airMoveDirection","_targetVariableID":"2fc91db6-09dd-4a1f-9195-426a0c44de31"},"jumpPower":{"_name":"jumpPower","_targetVariableID":"9a82efee-e317-423c-ad6e-5ef7e6145396"},"targetLocation":{"_name":"_grappleLaunchDir"},"offset":{"_value":{"y":1.0}},"relativeRotation":{},"launchRelativeTo":{},"useRelativeForce":{"_value":true},"minimumForce":{},"maximumForce":{"_value":100.0},"forceRelativeToDistance":{"_value":4.0},"force":{},"_isDisabled":true,"$type":"NodeCanvas.Tasks.Actions.StartLaunchJump"},{"grapplePoint":{"_name":"_grappleLaunchDir"},"speed":40.0,"horizontalDotBreak":-0.6,"verticalDotBreak":-0.2,"$type":"NodeCanvas.Tasks.Actions.DoGrapplePull"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"foldUpdate":true,"foldExit":true,"_color":{"r":0.5019608,"g":1.0,"b":0.9803922,"a":1.0},"_name":"Grapple","_position":{"x":-486.7946,"y":-172.0913},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"8"},{"_onEnterList":{"executionMode":1,"actions":[]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[{"valueA":{"_name":"airJumpsRemaining","_targetVariableID":"23f0ddc0-c4e8-462f-a7e0-fdd8e818d08d"},"Operation":2,"valueB":{"_value":1},"$type":"NodeCanvas.Tasks.Actions.SetInt"}]},"foldEnter":true,"foldExit":true,"_color":{"r":0.4132327,"g":0.945098,"b":0.254902,"a":1.0},"_name":"Post + Grapple Jump","_position":{"x":-238.9581,"y":-559.5018},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"9"},{"_actionList":{"actions":[{"moveSpeed":{"label":"Move + Speed","value":{"_value":15.0},"changeValue":1},"moveSpeedSoothing":{"label":"Move + Speed Smoothing","value":{"_value":0.5},"changeValue":1},"airDirectionDecay":{"label":"Air + Direction Decay","value":{}},"accelerationSmoothing":{"label":"Acceleration Smoothing","value":{"_value":1.0},"changeValue":1},"deaccelerationSmoothing":{"label":"Deacceleration + Smoothing","value":{"_value":0.5},"changeValue":1},"jumpPower":{"label":"Jump Power","value":{}},"jumpPowerDecay":{"label":"Jump Decay Speed","value":{},"changeValue":2},"gravityPower":{"label":"Gravity - Power","value":{},"changeValue":2},"gravityMax":{"label":"Gravity Max","value":{},"changeValue":2},"gravityAcceleration":{"label":"Gravity - Acceleration Speed","value":{"_value":0.5},"changeValue":1},"gravityScale":{"label":"Gravity + Power","value":{},"changeValue":2},"gravityMax":{"label":"Gravity Max","value":{"_value":4.5},"changeValue":1},"gravityAcceleration":{"label":"Gravity + Acceleration Speed","value":{"_value":1.0},"changeValue":1},"gravityScale":{"label":"Gravity Scale","value":{},"changeValue":2},"settingsChangeSmoothing":{"label":"Settings - Change Smoothing","value":{}},"rotationSpeed":{"label":"Rotation Speed","value":{}},"rotationSmoothing":{"label":"Rotation - Smoothing","value":{}},"rotationInputBlending":{"label":"Rotation Input Blending","value":{}},"feedNewRotation":{},"feedRelativeTo":{},"$type":"Reset.Core.ChangeMovementSettings"},{"valueA":{"_name":"newAirMoveSmoothing","_targetVariableID":"9ba7a222-e29f-4ef5-8f1e-144189e5e5d3"},"valueB":{"_value":0.6},"_isDisabled":true,"$type":"NodeCanvas.Tasks.Actions.SetFloat"},{"eventName":{"_value":"Delay + Change Smoothing","value":{"_value":0.2},"changeValue":1},"rotationSpeed":{"label":"Rotation + Speed","value":{}},"rotationSmoothing":{"label":"Rotation Smoothing","value":{}},"rotationInputBlending":{"label":"Rotation + Input Blending","value":{}},"feedNewRotation":{},"feedRelativeTo":{},"$type":"Reset.Core.ChangeMovementSettings"},{"valueA":{"_name":"newAirMoveSmoothing","_targetVariableID":"9ba7a222-e29f-4ef5-8f1e-144189e5e5d3"},"valueB":{"_value":0.6},"_isDisabled":true,"$type":"NodeCanvas.Tasks.Actions.SetFloat"},{"eventName":{"_value":"Delay Air Movement Reset"},"eventValue":{"_value":2.5},"delay":{},"$type":"NodeCanvas.Tasks.Actions.SendEvent`1[[System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}]},"_color":{"r":0.3647059,"g":0.3215686,"b":1.0,"a":1.0},"_name":"Post - Grapple Movement","_position":{"x":-232.4815,"y":-315.1414},"$type":"NodeCanvas.StateMachines.ActionState","$id":"10"},{"_position":{"x":-270.4407,"y":64.96476},"$type":"NodeCanvas.StateMachines.EmptyState","$id":"11"},{"_onEnterList":{"actions":[{"raycastHit":{"_name":"_wallStickHit"},"transform":{},"collider":{},"gameObject":{},"distance":{},"normal":{"_name":"_wallStickHitNormal"},"point":{"_name":"_wallStickHitPoint"},"$type":"NodeCanvas.Tasks.Actions.DecomposeRaycastHit"},{"moveSpeed":{"label":"Move + Grapple Movement","_position":{"x":-100.2183,"y":-237.2979},"$type":"NodeCanvas.StateMachines.ActionState","$id":"10"},{"_position":{"x":-270.4407,"y":64.96476},"$type":"NodeCanvas.StateMachines.EmptyState","$id":"11"},{"_onEnterList":{"actions":[{"raycastHit":{"_name":"_wallStickHit"},"transform":{},"collider":{},"gameObject":{},"distance":{},"normal":{"_name":"_wallStickHitNormal"},"point":{"_name":"_wallStickHitPoint"},"$type":"NodeCanvas.Tasks.Actions.DecomposeRaycastHit"},{"moveSpeed":{"label":"Move Speed","value":{},"changeValue":1},"moveSpeedSoothing":{"label":"Move Speed Smoothing","value":{},"changeValue":1},"airDirectionDecay":{"label":"Air Direction Decay","value":{}},"accelerationSmoothing":{"label":"Acceleration Smoothing","value":{},"changeValue":2},"deaccelerationSmoothing":{"label":"Deacceleration Smoothing","value":{},"changeValue":2},"feedNewDirection":{"label":"Feed New @@ -99577,7 +99579,7 @@ MonoBehaviour: Direction","newValue":{"$content":5,"$type":"PlayerFacingDirection"},"changeValue":1},"rotationSpeed":{"label":"Rotation Speed","value":{}},"rotationSmoothing":{"label":"Rotation Smoothing","value":{},"changeValue":1},"rotationInputBlending":{"label":"Rotation Input Blending","value":{},"changeValue":1},"feedNewRotation":{"_value":{"y":45.0}},"feedRelativeTo":{"_name":"_wallStickHitNormal"},"$type":"Reset.Core.ChangeMovementSettings"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"foldUpdate":true,"foldExit":true,"_color":{"r":0.4980392,"g":1.0,"b":0.9803922,"a":1.0},"_name":"Left - Wall Stick","_position":{"x":1293.098,"y":193.9184},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"16"},{"_actionList":{"executionMode":1,"actions":[{"moveSpeed":{"label":"Move + Wall Stick","_position":{"x":1293.098,"y":192.7727},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"16"},{"_actionList":{"executionMode":1,"actions":[{"moveSpeed":{"label":"Move Speed","value":{},"changeValue":2},"moveSpeedSoothing":{"label":"Move Speed Smoothing","value":{},"changeValue":2},"airDirectionDecay":{"label":"Air Direction Decay","value":{}},"accelerationSmoothing":{"label":"Acceleration Smoothing","value":{},"changeValue":1},"deaccelerationSmoothing":{"label":"Deacceleration Smoothing","value":{},"changeValue":1},"feedNewDirection":{"label":"Feed New @@ -99636,7 +99638,7 @@ MonoBehaviour: Scale","value":{}},"settingsChangeSmoothing":{"label":"Settings Change Smoothing","value":{}},"rotationSpeed":{"label":"Rotation Speed","value":{}},"rotationSmoothing":{"label":"Rotation Smoothing","value":{}},"rotationInputBlending":{"label":"Rotation Input Blending","value":{}},"feedNewRotation":{},"feedRelativeTo":{},"$type":"Reset.Core.ChangeMovementSettings"}]},"_color":{"r":0.3647059,"g":0.3215686,"b":1.0,"a":1.0},"_name":"Airborne - Standard Movement","_position":{"x":267.9286,"y":45.22851},"$type":"NodeCanvas.StateMachines.ActionState","$id":"22"},{"_actionList":{"executionMode":1,"actions":[{"moveSpeed":{"label":"Move + Standard Movement","_position":{"x":289.209,"y":32.46029},"$type":"NodeCanvas.StateMachines.ActionState","$id":"22"},{"_actionList":{"executionMode":1,"actions":[{"moveSpeed":{"label":"Move Speed","value":{},"changeValue":1},"moveSpeedSoothing":{"label":"Move Speed Smoothing","value":{}},"airDirectionDecay":{"label":"Air Direction Decay","value":{}},"accelerationSmoothing":{"label":"Acceleration Smoothing","value":{}},"deaccelerationSmoothing":{"label":"Deacceleration Smoothing","value":{}},"feedNewDirection":{"label":"Feed New Direction","newValue":{"z":1.0}},"jumpPower":{"label":"Jump @@ -99680,8 +99682,8 @@ MonoBehaviour: Direction","newValue":{"$content":4,"$type":"PlayerFacingDirection"},"changeValue":1},"rotationSpeed":{"label":"Rotation Speed","value":{}},"rotationSmoothing":{"label":"Rotation Smoothing","value":{}},"rotationInputBlending":{"label":"Rotation Input Blending","value":{}},"feedNewRotation":{},"feedRelativeTo":{},"$type":"Reset.Core.ChangeMovementSettings"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[{"valueA":{"_name":"airJumpsRemaining","_targetVariableID":"23f0ddc0-c4e8-462f-a7e0-fdd8e818d08d"},"Operation":2,"valueB":{"_value":1},"$type":"NodeCanvas.Tasks.Actions.SetInt"}]},"foldEnter":true,"foldExit":true,"_color":{"r":0.4117647,"g":0.945098,"b":0.254902,"a":1.0},"_name":"Run - Jump","_position":{"x":1010.719,"y":94.10208},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"25"},{"_subTree":{"_value":1},"_variablesMap":[{"_targetSubGraphVariableID":"e1cfd0be-7f55-420d-bdd8-e72531fc61ba","_canWrite":true,"_type":"UnityEngine.Transform","_value":{"$content":2,"$type":"UnityEngine.Transform"}},{"_targetSubGraphVariableID":"c4e68b75-5129-428c-8177-abb7b38986f5","_canWrite":true,"_type":"PlayerFacingDirection","_value":{"$content":0,"$type":"PlayerFacingDirection"}}],"_position":{"x":108.4589,"y":186.5594},"$type":"NodeCanvas.StateMachines.ConcurrentSubTree"},{"_subTree":{"_value":3},"_tag":"","_position":{"x":139.1634,"y":300.6739},"_comment":"","$type":"NodeCanvas.StateMachines.ConcurrentSubTree"},{"_conditionList":{"conditions":[]},"_actionList":{"executionMode":1,"actions":[{"targetVector":{"_name":"outputMoveDirection","_targetVariableID":"3b9833f5-870a-4182-9824-e31a9896eec2"},"x":{"_name":""},"y":{"_name":"_currentYMoveDirection"},"z":{"_name":""},"$type":"NodeCanvas.Tasks.Actions.DecomposeVector"}]},"_position":{"x":123.166,"y":680.5589},"$type":"NodeCanvas.StateMachines.OnFSMUpdate"},{"_onEnterList":{"executionMode":1,"actions":[]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"_color":{"r":0.4980392,"g":1.0,"b":0.9803922,"a":1.0},"_name":"Airborne - Standby","_position":{"x":1509.989,"y":-548.8954},"$type":"NodeCanvas.StateMachines.SuperActionState"},{"_subTree":{"_value":4},"_position":{"x":1132.543,"y":-344.117},"$type":"NodeCanvas.StateMachines.ConcurrentSubTree"}],"connections":[{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"619300a4-be8b-4ad4-ba2a-978468094ba2"},"valueB":{},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"actionName":{"_value":"Jump"},"actionPhase":{"_value":3},"$type":"NodeCanvas.Tasks.Conditions.CheckInput"},"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"21"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"eventName":{"_value":"Grapple + Jump","_position":{"x":1010.719,"y":94.10208},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"25"},{"_subTree":{"_value":1},"_variablesMap":[{"_targetSubGraphVariableID":"e1cfd0be-7f55-420d-bdd8-e72531fc61ba","_canWrite":true,"_type":"UnityEngine.Transform","_value":{"$content":2,"$type":"UnityEngine.Transform"}},{"_targetSubGraphVariableID":"c4e68b75-5129-428c-8177-abb7b38986f5","_canWrite":true,"_type":"PlayerFacingDirection","_value":{"$content":0,"$type":"PlayerFacingDirection"}}],"_position":{"x":-484.5411,"y":183.5594},"$type":"NodeCanvas.StateMachines.ConcurrentSubTree"},{"_subTree":{"_value":3},"_tag":"","_position":{"x":88.88627,"y":313.6888},"_comment":"","$type":"NodeCanvas.StateMachines.ConcurrentSubTree"},{"_conditionList":{"conditions":[]},"_actionList":{"executionMode":1,"actions":[{"targetVector":{"_name":"outputMoveDirection","_targetVariableID":"3b9833f5-870a-4182-9824-e31a9896eec2"},"x":{"_name":""},"y":{"_name":"_currentYMoveDirection"},"z":{"_name":""},"$type":"NodeCanvas.Tasks.Actions.DecomposeVector"}]},"_position":{"x":65.44448,"y":193.4959},"$type":"NodeCanvas.StateMachines.OnFSMUpdate"},{"_onEnterList":{"executionMode":1,"actions":[]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"_color":{"r":0.4980392,"g":1.0,"b":0.9803922,"a":1.0},"_name":"Airborne + Standby","_position":{"x":1509.989,"y":-548.8954},"$type":"NodeCanvas.StateMachines.SuperActionState"},{"_subTree":{"_value":4},"_position":{"x":1125.669,"y":-308.5995},"$type":"NodeCanvas.StateMachines.ConcurrentSubTree"}],"connections":[{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"619300a4-be8b-4ad4-ba2a-978468094ba2"},"valueB":{},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"actionName":{"_value":"Jump"},"actionPhase":{"_value":3},"$type":"NodeCanvas.Tasks.Conditions.CheckInput"},"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"21"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"eventName":{"_value":"Grapple Launch"},"saveEventValue":{"_name":"_grappleLaunchDir"},"$type":"NodeCanvas.Tasks.Conditions.CheckEvent`1[[UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"},"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"7"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"eventName":{"_value":"Grapple Pull"},"saveEventValue":{"_name":"_grappleLaunchDir"},"$type":"NodeCanvas.Tasks.Conditions.CheckEvent`1[[UnityEngine.Vector3, @@ -99718,8 +99720,8 @@ MonoBehaviour: _version: 3.31 _category: _comments: - _translation: {x: 1151, y: 677} - _zoomFactor: 0.9637517 + _translation: {x: 785, y: 675} + _zoomFactor: 0.8835846 _firstActivation: 0 _enableAction: 0 _disableAction: 0 diff --git a/Assets/Scripts/Player/UnitMovementHandler.cs b/Assets/Scripts/Player/UnitMovementHandler.cs index 547cec9..8ffb93e 100644 --- a/Assets/Scripts/Player/UnitMovementHandler.cs +++ b/Assets/Scripts/Player/UnitMovementHandler.cs @@ -64,20 +64,20 @@ namespace Reset.Units{ // public float value; // } - // Debug viewing - [ShowInInspector, ReadOnly] private float outputSpeed; - [ShowInInspector, ReadOnly] private float additionalSpeed; - [ShowInInspector, ReadOnly] public Vector3 outputMoveDirection; - [ShowInInspector, ReadOnly] public Vector3 additionalMoveDirection; - [ShowInInspector, ReadOnly] private Quaternion outputRotation; - [ShowInInspector, ReadOnly] private Quaternion specifiedRotation; - [ShowInInspector, ReadOnly] private float outputRotationSpeed; + // + [FoldoutGroup("Final Values"), ShowInInspector, ReadOnly] private float outputSpeed; + [FoldoutGroup("Final Values"), ShowInInspector, ReadOnly] private float additionalSpeed; + [FoldoutGroup("Final Values"), ShowInInspector, ReadOnly] public Vector3 outputMoveDirection; + [FoldoutGroup("Final Values"), ShowInInspector, ReadOnly] public Vector3 additionalMoveDirection; + [FoldoutGroup("Final Values"), ShowInInspector, ReadOnly] private Quaternion outputRotation; + [FoldoutGroup("Final Values"), ShowInInspector, ReadOnly] private Quaternion specifiedRotation; + [FoldoutGroup("Final Values"), ShowInInspector, ReadOnly] private float outputRotationSpeed; // Used by graph to gradually shift into new values rather than dump them. Even if they're smoothed values they need to be eased into - [ShowInInspector, ReadOnly] private float outputJumpDecay; - [ShowInInspector, ReadOnly] private float outputGravityAccel; - [ShowInInspector, ReadOnly] private float outputGravityScale; - [ShowInInspector, ReadOnly] private float settingsChangeRotationSpeed; + [FoldoutGroup("Smoothed Values"), ShowInInspector, ReadOnly] private float smoothedJumpDecay; + [FoldoutGroup("Smoothed Values"), ShowInInspector, ReadOnly] private float smoothedGravityAccel; + [FoldoutGroup("Smoothed Values"), ShowInInspector, ReadOnly] private float smoothedGravityScale; + [FoldoutGroup("Smoothed Values"), ShowInInspector, ReadOnly] private float settingsChangeRotationSpeed; private float directionChangeDot; private bool moveCallDisabledNextFrame; @@ -225,7 +225,7 @@ namespace Reset.Units{ // Update the gravity, called every frame private void UpdateCurrentGravity(){ // Accelerate gravity - data.gravityPower += outputGravityAccel * Time.deltaTime; + data.gravityPower += smoothedGravityAccel * Time.deltaTime; data.gravityPower = Mathf.Clamp(data.gravityPower, Mathf.NegativeInfinity, data.gravityMax); // Apply a constant gravity if the player is grounded @@ -310,7 +310,7 @@ namespace Reset.Units{ // Add their related speeds moveXZDir *= speed * Time.deltaTime; - moveYDir *= outputGravityScale * Time.deltaTime; + moveYDir *= smoothedGravityScale * Time.deltaTime; addDir *= additionalSpeed * Time.deltaTime; // Construct the direction and move @@ -325,9 +325,9 @@ namespace Reset.Units{ } private void SmoothingSettingsChanges(){ - outputJumpDecay = Mathf.Lerp(outputJumpDecay, data.jumpPowerDecay, data.settingsChangeSmoothing * Time.deltaTime); - outputGravityAccel = Mathf.Lerp(outputGravityAccel, data.gravityAcceleration, data.settingsChangeSmoothing * Time.deltaTime); - outputGravityScale = Mathf.Lerp(outputGravityScale, data.gravityScale, data.settingsChangeSmoothing * Time.deltaTime); + smoothedJumpDecay = Mathf.Lerp(smoothedJumpDecay, data.jumpPowerDecay, data.settingsChangeSmoothing * Time.deltaTime); + smoothedGravityAccel = Mathf.Lerp(smoothedGravityAccel, data.gravityAcceleration, data.settingsChangeSmoothing * Time.deltaTime); + smoothedGravityScale = Mathf.Lerp(smoothedGravityScale, data.gravityScale, data.settingsChangeSmoothing * Time.deltaTime); settingsChangeRotationSpeed = Mathf.Lerp(settingsChangeRotationSpeed, data.rotationSpeed, data.settingsChangeSmoothing * Time.deltaTime); } @@ -358,7 +358,7 @@ namespace Reset.Units{ private void UpdateGravityLate(){ // Decay jump power - data.jumpPower -= outputJumpDecay * Time.deltaTime; + data.jumpPower -= smoothedJumpDecay * Time.deltaTime; data.jumpPower = Mathf.Max(0f, data.jumpPower); } }