Change the gameobject position in 4 different ways
We can use different functions, even return type functions, to get the position to change. To do this, we will offset the cube and on start, have the cube be reset back to 0.
The first way is simply to get the gameobject and set it’s position to 0.
The second way is to create a function that is called on start that resets your position to 0. This is a fixed amount embedded inside the function, which doesn’t allow change!
The third way is to apply a parameter to the function and pass it through to the function.
Fourth, we can do a return function to set the position.
We can also add values to this to apply parameters as well.