Beispiel #1
0
    void Push(ObjectController target)
    {
        Vector2 BouceOffDirection = (Vector2)Vector3.Normalize(target.transform.position - OC.transform.position);

        target.NormalizeRigibody();
        target.AddForce(BouceOffDirection, Mathf.Floor(ScalingFactor) * 3 + 1, ForceMode2D.Impulse);
    }
Beispiel #2
0
    void Pull(ObjectController target)
    {
        Vector2 PullDirection = (Vector2)Vector3.Normalize(OC.transform.position - target.transform.position);

        //target.NormalizeRigibody();
        target.AddForce(PullDirection, PullForce, ForceMode2D.Impulse);
    }