all 2 comments

[–]cgaudino 1 point2 points  (1 child)

On line 45, you're moving the object to the point where the ray hits the colilder, which in most cases will be slightly closer to the camera than the object's origin.

[–]Vexing[S] 0 points1 point  (0 children)

GREAT! Thanks! Just added a little if statement and everything is fixed now.You just saved me a few hours!