Beispiel #1
0
    public void Rappel()
    {
        if (isLoaded || _arrow.deployed)
        {
            return;
        }

        Vector2 ropePoint = _rope.GetFirstPoint();

        _rgbd.velocity += (ropePoint - (Vector2)_trf.position).normalized * rappelForce * Time.deltaTime;

        float arrowDistance = Vector2.Distance(ropePoint, _arrow.transform.position);
        float pointDistance = Vector2.Distance(_trf.position, ropePoint);

        if (arrowDistance > 1f && pointDistance < 1.75f)
        {
            foreach (Vector2 dir in repelDirections)
            {
                RepelWall(dir);
            }
        }
    }