The result seems so far away since it counts as a direction. It shows the “bounce” direction if you shoot a light ray from your highlighted cube down to that A/B center point. It’s like if you ask someone which way is North – they could just point with a finger, or use their whole arm and it’s the same thing: “North is that way”. Exactly where their finger tip is doesn’t matter. Once you have the result, you can easily rescale it to the length you want, or use it in a raycast to see what it hits, and so on.
To understand inNormal, hide that silver plane from the image. Now we’re bouncing off the point A/B center. Hmmm … obviously, we also need to know which way the mirror is aimed – a mirror wall facing right, or forward? a mirror floor? some other angle? inNormal is what tells Reflect which way the mirror is facing. For example, if the floor is a mirror, use Vector3.up. If the mirror is a wall facing right, use Vector3.right. If the mirror is a flat plane, p1, that the user can turn, use p1.rotation.eulerAngles.y.
using UnityEngine;
public class Reflect : MonoBehaviour
{
public Transform A;
public Transform B;
public Transform InDirection;
public Transform Result;
private void Update()
{
var inNormal = (B.position - A.position).normalized;
var result = Vector3.Reflect(A.position-InDirection.position, inNormal);
Result.position = result+A.position;
Debug.DrawLine(InDirection.position,A.position,Color.yellow,0.1f);
Debug.DrawLine(A.position,Result.position,Color.yellow,0.1f);
}
}