Trying to get character to instantly rotate in 2.5d side scroller

So I need the character to “flip” sides whenever the mouse is on the left or right of the screen. I’d like to say I’m very new to scripting and only know the basics, which is part of my problem. I figured if I could right a true false statement that involved the Mouse X input then I could just flip the object whenever the mouse x value was below 0. The error comes in the line where I’m trying to do the rotation.

Hopefully I’m making some sense

var lookForward : boolean = true;

function Update () {
 
 	if(Input.GetAxis("Mouse X") < 0) {
		
		lookForward = false;
 	
 	}
 	
 	if(!lookForward) {
 	
 		transform.Rotate.Vector3(0, -90, 0 * Time.deltaTime);
 		
 		}

}

transform.Rotate.Vector3 doesn’t exist: you should write transform.Rotate(Vector3(…));

Anyway, the code you’re using turns the character -90 degrees each frame the mouse is moving to the right. In order to flip the character left/right when the mouse is on the left/right sides of the screen, use this:

private var lookLeft: Quaternion;
private var lookRight: Quaternion;

function Start(){
  // assuming character starts looking to the right:
  lookRight = transform.rotation;
  // calculate rotation flipped 180 degrees:
  lookLeft = lookRight * Quaternion.Euler(0, 180, 0); 
}

function Update(){
  // if mouse is on the left side of the screen...
  if (Input.mousePosition.x < Screen.width/2){
    transform.rotation = lookLeft; // look left
  } else {
    transform.rotation = lookRight; // look right
  }
}