コード例 #1
0
    private void LateUpdate()
    {
        if (target != null)
        {
            //Get new direction to target
            dir = target.getDirection(transform.position, target.objectHeight) * -1;

            //Angle toward new target
            transform.right = target.transform.position - transform.position;
        }

        rb2D.MovePosition(transform.position + (dir * velocity));
    }