logic order should be:
Code:
check the moving boolean
if it's false
{
check the input axes thing
if you have a key/whatever pressed
{
set movevelocity to some value based on which direction you need to move.
set moving to true
}
}
if it's true
{
transform.Translate(movevelocity*time_elapsed)
}
on collision with other block
set moving to false.
Edit: actually just try replacing your transfrom.translate(v*4,0,0) with transform.translate(moveVelocity)
and assign the moveVelocity variable based on the input.