movement is continuous

void update(){

if(Input.GetKey(KeyCode.A)){
transform.position -= transform.right * speed * 2;
if(speed < 1){
speed = speed + .001f;
}

	if( currenthp < maxhp){
		currenthp += 1;
		}	
	
		
}

That code moves my character to the left, but I have another piece of code

void OnCollisionEnter(Collision collision) {

if(collision.gameObject.name == "fallb"){
		Vector3 tempvect = new Vector3(150, 730, -772);
		rigidbody.position = tempvect;
		
	}

}

This is made to send him back to beginning if struck, but it only does that when it’s standing completely still. If it’s moving, the falling block just lands right on top of it and stays there.
Any advice?

Colliders don’t work well when changing transform.position to move an object, since you’re basically teleporting the object. I would suggest moving your character in a different way, e.g. if it has a RigidBody use MovePosition() or AddForce(), if it has a CharacterController use Move() or SimpleMove().