diff --git a/Assets/Materials/PlayerMaterial.physicMaterial b/Assets/Materials/PlayerMaterial.physicMaterial index 7e88d8b..85fae2f 100644 --- a/Assets/Materials/PlayerMaterial.physicMaterial +++ b/Assets/Materials/PlayerMaterial.physicMaterial @@ -7,8 +7,8 @@ PhysicMaterial: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: PlayerMaterial - dynamicFriction: 0 - staticFriction: 0 + dynamicFriction: 1 + staticFriction: 1 bounciness: 0 frictionCombine: 0 bounceCombine: 0 diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index fa24d59..bb22bd9 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -101,14 +101,13 @@ public class PlayerController : MonoBehaviour { return; } - Physics.gravity = this.downDirection * 9.81f; // if (platform.type == PlatformManager.PlatformType.SpeedUp) // { angle = Mathf.Atan2(Vector3.Magnitude(axis), Vector3.Dot(-transform.up, -other.GetContact(0).normal)); transform.RotateAround(axis, angle); // } // TODO: Handle other PlatformTypes - Physics.gravity = this.downDirection * 9.81f; + Physics.gravity = -other.GetContact(0).normal * 9.81f; } @@ -141,7 +140,7 @@ public class PlayerController : MonoBehaviour Vector3 gDirection; PlatformManager platform = other.gameObject.GetComponent(); - gDirection = -transform.up; + gDirection = -other.GetContact(0).normal; if (platform == null){ // FIXME: remove this.downDirection = -transform.up;