I have a piece of script to make a cube go forward and after 100 steps change its direction to the opposite, and so on. I did this by using Translate method, and it works. Below is the script:
I’m a beginner, so I’m trying to understand differences between Translate and transform.position, so I basically want the cube to behave in the same way by using either Translate or transform.position. How should I do it? I tried to write script in the same way as via Translate - by using “counter” but it doesn’t work. The cube goes to one direction and never comes back. I tried several other ideas but they also didn’t work. Please help.