unity apply force towards object code example
Example: unity addforce towards target
rigidbody.AddForce((target.position - transform.position) * multiplicationFactor);
rigidbody.AddForce((target.position - transform.position) * multiplicationFactor);