I have an object that moves around a scene:
rigidbody.AddForce(Vector3(1,1,0));
is how I am moving this object. The scene has a number of cubes randomly placed in it. I want the object to bounce off these cubes and keep moving.
the Vector3.Reflect takes 2 arguments:
Reflect (inDirection : Vector3, inNormal : Vector3)
what do I enter for inNormal?
Objects bouncing or not bouncing is an issue of the physics material of the objects. Vector3.Reflect() will not make them bounce. Vector3.Reflect() simply takes a vector (a mathematical construct) returns a vector. A normal vector is a vector perpendicular to a surface, so inNormal is the normal of he surface the ray is being reflected against. If you need the normal and know the direction an object is moving, you can use any version Physics.Raycast() that takes a RaycastHit as a parameter. RaycastHit returns the normal of the surface it hits.
Note a simple Vector3.Reflect is an imperfect method of determining the direction of an object after a bounce.