unity missile script code example
Example: Unity make a homing object
Vector2 direction = (Vector2)Target.position - rb.position;
direction.Normalize();
float RotateAmount = Vector3.Cross(direction, transform.up).z;
rb.angularVelocity = -RotateSpeed * RotateAmount;
rb.velocity = transform.up * Speed;