I have an object, you can only move it along the X axis, but if you move it a lot, it will wobble and move along the Z axis. Here is a video to show what I mean.
I tried puting this code in the Update method and FixedUpdate method but no luck, I didn’t get errors for the code though
Vector3 Pos = rb.transform.position;
Quaternion Rot = rb.transform.rotation;
Pos.z = 0;
Rot.y = 0;
and I tried without putting rb, with no luck. I tried putting the code in a while loop, and unity froze ![]()
I tried not to ask dumb questions, but I haven’t found any solutions, this is my first time using unity and C#.

Yeah, I figured that out! But thank you anyway! I should have say that :P
– DerpyGamerYT