I know the title is a little confusing, but what I want to accomplish is rather simple. I am aiming to make a Vector3 called velStore(which is used for movement) evenly transition to Vector3.zero. For instance,
velStore.x = 5;
velStore.z = 10;
if velStore.z goes down by 1, velStore.x will go down by 0.5 and repeat this until they become 0. I want to transition rate to be constant, and not slide and go down less near the end of the transition.
Of course you could create different functions depending on if you wanna change x, y or z, or you could have which one to change as a parameter in the function:
ChangeVel (float value, int index)
{
if(index > 2 )
{
Debug.LogError(“Index out of range in ChangeVel”);
Executing this line once will move linearly towards (0,0,0) by 1 unit in total. Though that 1 unit is 1 unit along the vector, not along one particular axis. Usually when called every frame you would do