I use the keyboard wsad to control the movement of the object, the code is as follows:
Here's a description of my code.
The Back,forward,right,left are moved in the coordinates of the object you want to control moving.
My code is moving left and right on the z axis, moving up and down on the x-axis, supposedly, by pressing a, the object should be vector.left instead of vector.right. This is because I rotate the object around the y axis 180° when I put it, and if I press a for left, I press A to go right. So I'm going to press a right and go.
As for the numbers in the judging condition, this is achieved by moving the object you want to move to the most leftmost and leftmost data in the game field. It means not to let the object run beyond the field of view.
Unity3d Small white Code control object through the keyboard input movement