Explanation of Vector3.Reflect

Hello everyone.

Can someone please explain the PROBER method and usage of Vector3.Reflect, since I really have no idea on how to make it work proberly.

From the script reference:

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
    public Transform originalObject;
    public Transform reflectedObject;
    void Update() {
        reflectedObject.position = Vector3.Reflect(originalObject.position, Vector3.right);
    }
}

The first argument to Vector3.Reflect is the incoming vector to be reflected across the normal, which is the second argument. Remember that the surface normal needs to be normalized to give a proper new direction.

Another example:

    Vector3 rayDir = Vector3.right;
    //normalized
    Vector3 reflected = Vector3.Reflect(rayDir, Vector3.left);
    Debug.Log("Ray dir: " + rayDir + "   Reflected dir: " + reflected);

    // Un-normalized
    reflected = Vector3.Reflect(rayDir, Vector3.left*5);
    Debug.Log("Ray dir: " + rayDir + "   Reflected dir: " + reflected);

this gives output:

Ray dir: (1.0, 0.0, 0.0) Reflected dir: (-1.0, 0.0, 0.0)

Ray dir: (1.0, 0.0, 0.0) Reflected dir: (-49.0, 0.0, 0.0)

As you can see, the incoming direction is fliped in its x-direction acording to the law of reflection. You could read this link for more information on how this works

http://www.codeproject.com/KB/graphics/SamplePamperPart2.aspx