diff --git a/Assets/3D Models/VillainGuy/VillainGuyController.controller b/Assets/3D Models/VillainGuy/VillainGuyController.controller index a7a4dc6..14e3c86 100644 --- a/Assets/3D Models/VillainGuy/VillainGuyController.controller +++ b/Assets/3D Models/VillainGuy/VillainGuyController.controller @@ -38,7 +38,8 @@ m_Name: Pistol Locomotion m_Speed: 1 m_CycleOffset: 0 - m_Transitions: [] + m_Transitions: + - {fileID: -2070494933896505967} m_StateMachineBehaviours: [] m_Position: {x: 50, y: 50, z: 0} m_IKOnFeet: 0 @@ -54,6 +55,31 @@ m_MirrorParameter: m_CycleOffsetParameter: m_TimeParameter: +--- !u!1101 &-2070494933896505967 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 2 + m_ConditionEvent: InCombat + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 0} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 1 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.79452056 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 --- !u!1101 &-1661100348595344887 AnimatorStateTransition: m_ObjectHideFlags: 1 @@ -112,6 +138,24 @@ m_DefaultInt: 0 m_DefaultBool: 0 m_Controller: {fileID: 9100000} + - m_Name: VelX + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + - m_Name: VelY + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + - m_Name: InCombat 0 + m_Type: 4 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} m_AnimatorLayers: - serializedVersion: 5 m_Name: Base Layer @@ -238,8 +282,8 @@ m_CycleOffset: 0 m_DirectBlendParameter: Velocity m_Mirror: 0 - m_BlendParameter: Velocity - m_BlendParameterY: Velocity + m_BlendParameter: VelX + m_BlendParameterY: VelY m_MinThreshold: 0 m_MaxThreshold: 1 m_UseAutomaticThresholds: 1 diff --git a/Assets/OutdoorsScene.unity b/Assets/OutdoorsScene.unity index 8f76abe..144e306 100644 --- a/Assets/OutdoorsScene.unity +++ b/Assets/OutdoorsScene.unity @@ -2348,7 +2348,7 @@ m_Script: {fileID: 11500000, guid: 4ca9d77c5d8fc0c4ab7fe75c438ce37f, type: 3} m_Name: m_EditorClassIdentifier: - initialState: {fileID: 11400000, guid: 5cbbeaa160b8b924ea4853282a634acc, type: 2} + initialState: {fileID: 11400000, guid: 4ac7c5c1361bdf343ba39fef90f74cb4, type: 2} currentState: {fileID: 0} controller: {fileID: 0} --- !u!114 &2053026943 diff --git a/Assets/Scripts/NPC/FSM/Actions/Combat.meta b/Assets/Scripts/NPC/FSM/Actions/Combat.meta new file mode 100644 index 0000000..c986410 --- /dev/null +++ b/Assets/Scripts/NPC/FSM/Actions/Combat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bdfcba9f8ff112f4885112a01e4de081 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/NPC/FSM/Actions/Combat/Ranged.meta b/Assets/Scripts/NPC/FSM/Actions/Combat/Ranged.meta new file mode 100644 index 0000000..20ca6c0 --- /dev/null +++ b/Assets/Scripts/NPC/FSM/Actions/Combat/Ranged.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9a0756ca7875719448c1bd6b0a6ddaa9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/NPC/FSM/Actions/Combat/Ranged/EngagePlayerAction.asset b/Assets/Scripts/NPC/FSM/Actions/Combat/Ranged/EngagePlayerAction.asset new file mode 100644 index 0000000..01c594a --- /dev/null +++ b/Assets/Scripts/NPC/FSM/Actions/Combat/Ranged/EngagePlayerAction.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3ac742eeaffca6a469ce302420dfcff0, type: 3} + m_Name: EngagePlayerAction + m_EditorClassIdentifier: + lookAt: {fileID: 11400000, guid: 3a23ebad3bebabe46af891670f1b15d1, type: 2} + targetDistance: 2 diff --git a/Assets/Scripts/NPC/FSM/Actions/Combat/Ranged/EngagePlayerAction.asset.meta b/Assets/Scripts/NPC/FSM/Actions/Combat/Ranged/EngagePlayerAction.asset.meta new file mode 100644 index 0000000..0454f17 --- /dev/null +++ b/Assets/Scripts/NPC/FSM/Actions/Combat/Ranged/EngagePlayerAction.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 303bb23a22c10fc42af07fcdac010d58 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/NPC/FSM/Actions/Combat/Ranged/EngagePlayerAction.cs b/Assets/Scripts/NPC/FSM/Actions/Combat/Ranged/EngagePlayerAction.cs new file mode 100644 index 0000000..49a25ce --- /dev/null +++ b/Assets/Scripts/NPC/FSM/Actions/Combat/Ranged/EngagePlayerAction.cs @@ -0,0 +1,34 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEngine.AI; + +[CreateAssetMenu(menuName = "Finite State Machine/Action/Combat/Ranged/EngagePlayer")] +public class EngagePlayerAction : Action +{ + [SerializeField] private LookAt lookAt; + [SerializeField] private float targetDistance = 2.0f; + public override void Execute(FSM fsm) + { + NavMeshAgent agent = fsm.Controller.Agent; + GameObject target = fsm.Controller.AgentFOV.GetTarget(); + Animator anim = fsm.Controller.Animator; + + //If the agent has a target + if (target != null) + { + lookAt.SetTarget(target); + lookAt.Execute(fsm); + + //Sets the combat locomotion for the enemy + anim.SetBool("InCombat", true); + agent.stoppingDistance = targetDistance; + + if (agent.stoppingDistance >= targetDistance) + { + agent.destination = target.transform.position; + } + } + } +} diff --git a/Assets/Scripts/NPC/FSM/Actions/Combat/Ranged/EngagePlayerAction.cs.meta b/Assets/Scripts/NPC/FSM/Actions/Combat/Ranged/EngagePlayerAction.cs.meta new file mode 100644 index 0000000..bb8920a --- /dev/null +++ b/Assets/Scripts/NPC/FSM/Actions/Combat/Ranged/EngagePlayerAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3ac742eeaffca6a469ce302420dfcff0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/NPC/FSM/Actions/Others.meta b/Assets/Scripts/NPC/FSM/Actions/Others.meta new file mode 100644 index 0000000..4f4e555 --- /dev/null +++ b/Assets/Scripts/NPC/FSM/Actions/Others.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eecacee35d091ce429997e003ee8bf26 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/NPC/FSM/Actions/Others/LookAt.cs b/Assets/Scripts/NPC/FSM/Actions/Others/LookAt.cs new file mode 100644 index 0000000..483765a --- /dev/null +++ b/Assets/Scripts/NPC/FSM/Actions/Others/LookAt.cs @@ -0,0 +1,15 @@ +using System.Collections; +using System.Collections.Generic; +using Unity.VisualScripting; +using UnityEngine; +using UnityEngine.AI; + +[CreateAssetMenu(menuName = "Finite State Machine/Action/Others/LookAt")] +public class LookAt : Action +{ + [Header("LookAt Object")] + [SerializeField] private GameObject target; + public override void Execute(FSM fsm) => fsm.transform.LookAt(target.transform); + + public void SetTarget(GameObject target) => this.target = target; +} diff --git a/Assets/Scripts/NPC/FSM/Actions/Others/LookAt.cs.meta b/Assets/Scripts/NPC/FSM/Actions/Others/LookAt.cs.meta new file mode 100644 index 0000000..a3049fb --- /dev/null +++ b/Assets/Scripts/NPC/FSM/Actions/Others/LookAt.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ecd1bdae7c5449740a4384c5f82f3b0d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/NPC/FSM/Actions/Others/LookAtEnemyTarget.asset b/Assets/Scripts/NPC/FSM/Actions/Others/LookAtEnemyTarget.asset new file mode 100644 index 0000000..754f19e --- /dev/null +++ b/Assets/Scripts/NPC/FSM/Actions/Others/LookAtEnemyTarget.asset @@ -0,0 +1,15 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ecd1bdae7c5449740a4384c5f82f3b0d, type: 3} + m_Name: LookAtEnemyTarget + m_EditorClassIdentifier: + target: {fileID: 0} diff --git a/Assets/Scripts/NPC/FSM/Actions/Others/LookAtEnemyTarget.asset.meta b/Assets/Scripts/NPC/FSM/Actions/Others/LookAtEnemyTarget.asset.meta new file mode 100644 index 0000000..2f1dced --- /dev/null +++ b/Assets/Scripts/NPC/FSM/Actions/Others/LookAtEnemyTarget.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3a23ebad3bebabe46af891670f1b15d1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/NPC/FSM/FSM.cs b/Assets/Scripts/NPC/FSM/FSM.cs index cefdccc..6941d31 100644 --- a/Assets/Scripts/NPC/FSM/FSM.cs +++ b/Assets/Scripts/NPC/FSM/FSM.cs @@ -49,7 +49,7 @@ //Changes the current state to a new state public void ChangeState(State newState) { - currentState?.ExitAction().Execute(this); //Exececutes the exit action of the current state + currentState?.ExitAction()?.Execute(this); //Exececutes the exit action of the current state currentState = newState; //Changes the state currentState?.Enter(this); //Executes } diff --git a/Assets/Scripts/NPC/FSM/States/Alive/Alive.asset b/Assets/Scripts/NPC/FSM/States/Alive/Alive.asset index 8076981..2e4e658 100644 --- a/Assets/Scripts/NPC/FSM/States/Alive/Alive.asset +++ b/Assets/Scripts/NPC/FSM/States/Alive/Alive.asset @@ -17,4 +17,6 @@ exitAction: {fileID: 0} transitions: [] initialSubState: {fileID: 11400000, guid: 5cbbeaa160b8b924ea4853282a634acc, type: 2} - subStates: [] + subStates: + - {fileID: 11400000, guid: 5cbbeaa160b8b924ea4853282a634acc, type: 2} + - {fileID: 11400000, guid: 7248b9c0f406d71419ee6b3dee045891, type: 2} diff --git a/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/Covered.asset b/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/Covered.asset deleted file mode 100644 index 9e37018..0000000 --- a/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/Covered.asset +++ /dev/null @@ -1,20 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d0e7b5ba3c7cfc843bcdd88fcd76de11, type: 3} - m_Name: Covered - m_EditorClassIdentifier: - entryAction: {fileID: 0} - actions: [] - exitAction: {fileID: 0} - transitions: [] - initialSubState: {fileID: 0} - subStates: [] diff --git a/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/Covered.asset.meta b/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/Covered.asset.meta deleted file mode 100644 index d63812d..0000000 --- a/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/Covered.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1b3bae95f7aec1a478f358b25487cd61 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/CoveredState.asset b/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/CoveredState.asset new file mode 100644 index 0000000..26452e4 --- /dev/null +++ b/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/CoveredState.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0e7b5ba3c7cfc843bcdd88fcd76de11, type: 3} + m_Name: CoveredState + m_EditorClassIdentifier: + entryAction: {fileID: 0} + actions: [] + exitAction: {fileID: 0} + transitions: [] + initialSubState: {fileID: 0} + subStates: [] diff --git a/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/CoveredState.asset.meta b/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/CoveredState.asset.meta new file mode 100644 index 0000000..d63812d --- /dev/null +++ b/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/CoveredState.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1b3bae95f7aec1a478f358b25487cd61 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/EngagePlayerState.asset b/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/EngagePlayerState.asset new file mode 100644 index 0000000..8cbc6f7 --- /dev/null +++ b/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/EngagePlayerState.asset @@ -0,0 +1,21 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0e7b5ba3c7cfc843bcdd88fcd76de11, type: 3} + m_Name: EngagePlayerState + m_EditorClassIdentifier: + entryAction: {fileID: 0} + actions: + - {fileID: 11400000, guid: 303bb23a22c10fc42af07fcdac010d58, type: 2} + exitAction: {fileID: 0} + transitions: [] + initialSubState: {fileID: 0} + subStates: [] diff --git a/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/EngagePlayerState.asset.meta b/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/EngagePlayerState.asset.meta new file mode 100644 index 0000000..d71ecf2 --- /dev/null +++ b/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/EngagePlayerState.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 63273e20759d3cc4da713ccd0a9bafdc +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/RangedCombatState.asset b/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/RangedCombatState.asset index 4911e74..e47521a 100644 --- a/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/RangedCombatState.asset +++ b/Assets/Scripts/NPC/FSM/States/Alive/Combat/RangedCombat/RangedCombatState.asset @@ -16,5 +16,7 @@ actions: [] exitAction: {fileID: 0} transitions: [] - initialSubState: {fileID: 0} - subStates: [] + initialSubState: {fileID: 11400000, guid: 63273e20759d3cc4da713ccd0a9bafdc, type: 2} + subStates: + - {fileID: 11400000, guid: 1b3bae95f7aec1a478f358b25487cd61, type: 2} + - {fileID: 11400000, guid: 63273e20759d3cc4da713ccd0a9bafdc, type: 2} diff --git a/Assets/Scripts/NPC/FSM/States/Alive/Dead.asset b/Assets/Scripts/NPC/FSM/States/Alive/Dead.asset deleted file mode 100644 index efaa574..0000000 --- a/Assets/Scripts/NPC/FSM/States/Alive/Dead.asset +++ /dev/null @@ -1,20 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d0e7b5ba3c7cfc843bcdd88fcd76de11, type: 3} - m_Name: Dead - m_EditorClassIdentifier: - entryAction: {fileID: 0} - actions: [] - exitAction: {fileID: 0} - transitions: [] - initialSubState: {fileID: 0} - subStates: [] diff --git a/Assets/Scripts/NPC/FSM/States/Alive/Dead.asset.meta b/Assets/Scripts/NPC/FSM/States/Alive/Dead.asset.meta deleted file mode 100644 index 97183aa..0000000 --- a/Assets/Scripts/NPC/FSM/States/Alive/Dead.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b5ca5f821cc6fa949bd14a5e6a4d4881 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/NPC/FSM/States/Alive/Patrol/PatrolState.asset b/Assets/Scripts/NPC/FSM/States/Alive/Patrol/PatrolState.asset index d61ec49..836c82f 100644 --- a/Assets/Scripts/NPC/FSM/States/Alive/Patrol/PatrolState.asset +++ b/Assets/Scripts/NPC/FSM/States/Alive/Patrol/PatrolState.asset @@ -15,7 +15,7 @@ entryAction: {fileID: 11400000, guid: 866e0d454bb072641800b7939c862b81, type: 2} actions: - {fileID: 11400000, guid: a71dcfefa04e51942b941e504ec1f3d2, type: 2} - exitAction: {fileID: 0} + exitAction: {fileID: 11400000, guid: a71dcfefa04e51942b941e504ec1f3d2, type: 2} transitions: - {fileID: 11400000, guid: 9877abf3db0e7e24aa45c90fe5889240, type: 2} initialSubState: {fileID: 0} diff --git a/Assets/Scripts/NPC/FSM/States/Dead.asset b/Assets/Scripts/NPC/FSM/States/Dead.asset new file mode 100644 index 0000000..efaa574 --- /dev/null +++ b/Assets/Scripts/NPC/FSM/States/Dead.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0e7b5ba3c7cfc843bcdd88fcd76de11, type: 3} + m_Name: Dead + m_EditorClassIdentifier: + entryAction: {fileID: 0} + actions: [] + exitAction: {fileID: 0} + transitions: [] + initialSubState: {fileID: 0} + subStates: [] diff --git a/Assets/Scripts/NPC/FSM/States/Dead.asset.meta b/Assets/Scripts/NPC/FSM/States/Dead.asset.meta new file mode 100644 index 0000000..97183aa --- /dev/null +++ b/Assets/Scripts/NPC/FSM/States/Dead.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b5ca5f821cc6fa949bd14a5e6a4d4881 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/NPC/NPCController.cs b/Assets/Scripts/NPC/NPCController.cs index fc603a7..013a0d9 100644 --- a/Assets/Scripts/NPC/NPCController.cs +++ b/Assets/Scripts/NPC/NPCController.cs @@ -76,6 +76,8 @@ animator.SetBool("IsMoving", shouldMove); animator.SetFloat("Velocity", Velocity.magnitude); + animator.SetFloat("VelX", Velocity.x); + animator.SetFloat("VelY", Velocity.y); float deltaMagnitude = worldDeltaPosition.magnitude;