Edit little functions

This commit is contained in:
haitem 2022-01-29 22:07:57 +01:00
parent a141a6b50a
commit fde48cbda6

View File

@ -140,7 +140,7 @@ public class PlayerController : MonoBehaviour
float step = platform.speed * Time.deltaTime * 10f; float step = platform.speed * Time.deltaTime * 10f;
rb.AddForce((pullObject.transform.position - transform.position) * step, ForceMode.Force); rb.AddForce((pullObject.transform.position - transform.position) * step, ForceMode.Force);
} }
if (Vector3.Distance(pullObject.transform.position, transform.position) > 10f) if (Vector3.Distance(pullObject.transform.position, transform.position) > 5f)
{ {
pullObject = null; pullObject = null;
} }
@ -154,7 +154,7 @@ public class PlayerController : MonoBehaviour
float step = platform.speed * Time.deltaTime * 10f; float step = platform.speed * Time.deltaTime * 10f;
rb.AddForce(-(pushObject.transform.position - transform.position) * step, ForceMode.Force); rb.AddForce(-(pushObject.transform.position - transform.position) * step, ForceMode.Force);
} }
if (Vector3.Distance(pushObject.transform.position, transform.position) > 10f) if (Vector3.Distance(pushObject.transform.position, transform.position) > 5f)
{ {
pushObject = null; pushObject = null;
} }