time.Deltatime not counting Upwards

This script is suppose to make a loop of a cube moving back and forth.

var end : float = 4.0;
var Move : int = 8; 

function Update () {
	if(end <= 4) 
		{
		Move = 8; 
		transform.Translate(0, 0, Move * Time.deltaTime);
			end -= Time.deltaTime;
		 
		if(end <= 0) 
		{
		end += Time.deltaTime;
		Move = -16;
			transform.Translate(0, 0, Move * Time.deltaTime);				  
			}
		}	
	}

But the timer doesn’t go back up. It doesn’t stay at zero either, which is weird. the variable Move is set equal to -16 and then the variable end locks in place around 0.005373292, but doesn’t rise back up to 4 to continue the loop. The cube then infinitely goes backwards. Is their a specific way to make Time.deltaTime go up once its already going down?

The logic of your code is the problem. The outer if statement is lowering it as long as it is <= to 4. Then it checks whether it is <= 0 to move it up. So it will get to zero and keep trying to go back and forward since they are interfering with each other.

What you want is a cube to go back and forward over 4 seconds? Try using an InvokeRepeating as well as a boolean variable to keep track of which direction you want. The InvokeRepeating can keep swapping the bool and the cube moves based on the bool. Check the Unity docs for how InvokeRepeating works.