Edit player script

This commit is contained in:
haitem
2022-01-29 12:50:26 +01:00
parent 5a1c546b4f
commit 435fea4669
2 changed files with 4 additions and 5 deletions

View File

@@ -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<PlatformManager>();
gDirection = -transform.up;
gDirection = -other.GetContact(0).normal;
if (platform == null){
// FIXME: remove
this.downDirection = -transform.up;