Vector3.Reflect Manual     Reference     Scripting  
Scripting > Runtime Classes > Vector3
Vector3.Reflect

static function Reflect (inDirection : Vector3, inNormal : Vector3) : Vector3

Description

Reflects the vector along the normal.

The returned value is inDirection reflected from a surface with a normal inNormal.

var originalObject : Transform;
var reflectedObject : Transform;

function Update () {
// Makes the reflected object appear opposite of the original object,
// mirrored along the z-axis of the world
reflectedObject.position = Vector3.Reflect (originalObject.position, Vector3.right);
}