Bug when using transform direction


I am using this code in my cover system it only needs to go left and right but it also moves in z axis181557-22d.jpg

because of this 0.1 value it also moves in the z axis,Even if this value is 0.0, there is movement in the z-axis.

I would say that it’s this line that messes up everything:

 direc = transform.TransformDirection(direc);

Have you tried removing it?