// ... somewhere in your code...
minigun.angles = orientToNormal(trace["normal"]);
trace is undefined