From 9d4651c2f2713f61755d21c59d0dbb90b301de2e Mon Sep 17 00:00:00 2001 From: Thien Trandinh Date: Sat, 17 Aug 2019 11:27:07 -0400 Subject: [PATCH] Fixed issue of player being able to walk tbrough monsters --- TPK/Assets/Resources/Player Avatars/Player.prefab | 6 +++--- TPK/Assets/Scripts/Hero/HeroController.cs | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/TPK/Assets/Resources/Player Avatars/Player.prefab b/TPK/Assets/Resources/Player Avatars/Player.prefab index 6369344..04d1119 100644 --- a/TPK/Assets/Resources/Player Avatars/Player.prefab +++ b/TPK/Assets/Resources/Player Avatars/Player.prefab @@ -2729,13 +2729,13 @@ Rigidbody: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1389239392925404} serializedVersion: 2 - m_Mass: 1000 + m_Mass: 100 m_Drag: 0 m_AngularDrag: 0.5 m_UseGravity: 1 m_IsKinematic: 0 m_Interpolate: 0 - m_Constraints: 112 + m_Constraints: 116 m_CollisionDetection: 0 --- !u!81 &81270934823258956 AudioListener: @@ -3365,7 +3365,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_TransformSyncMode: 3 m_SendInterval: 0.04761905 - m_SyncRotationAxis: 2 + m_SyncRotationAxis: 7 m_RotationSyncCompression: 0 m_SyncSpin: 0 m_MovementTheshold: 0.001 diff --git a/TPK/Assets/Scripts/Hero/HeroController.cs b/TPK/Assets/Scripts/Hero/HeroController.cs index f457d6c..c415ef9 100644 --- a/TPK/Assets/Scripts/Hero/HeroController.cs +++ b/TPK/Assets/Scripts/Hero/HeroController.cs @@ -97,10 +97,7 @@ void Update() bool leftPressed = unityService.GetKey(CustomKeyBinding.GetLeftKey()); bool rightPressed = unityService.GetKey(CustomKeyBinding.GetRightKey()); tempVelocity = heroModel.GetCharacterMovement().Calculate(forwardPressed, backPressed, leftPressed, rightPressed); - if(heroRigidbody.velocity.y > 0) - tempVelocity.y = 0; - else - tempVelocity.y = heroRigidbody.velocity.y; + tempVelocity.y = heroRigidbody.velocity.y; heroRigidbody.velocity = tempVelocity; PerformRotation();