Convert rigidbody velocity to home in on target when it gets close

Hey, I’m having a bit of difficulty figuring something out with a projectile object.

The object originally gets launched and moves via rigidbody velocity.

I’m trying to find a way to keep that velocity and redirect it to slightly home in on the enemy if the object gets within a certain distance of an enemy as a form of aim assist.

Any tips or ideas? Any help at all would be much appreciated.

*Exact speed or close enough to.

Check if your shuriken’s Vector3.distance to the target object is within a threshold, and add a force to it that is equal to target.transform.position minus shuriken.transform.position, multiplied by whatever speed you want :slight_smile:

Example of script on shuriken:

void Update(){
if(Vector3.Distance(transform.position, target.transform.position) < maxDistForAimAssist)){
GetComponent<Rigidbody>().AddForce((target.transform.position - transform.Position) * assistForce);
}

}