I am making a game and I get this error saying “Assets/AIscript.cs(52,10): error CS1525: Unexpected symbol tempVector', expecting )‘, ,', ;’, [', or ='”
Heres my code:
{
// find vector to move
inputMovement = new Vector3( Input.GetAxis(“Horizontal”),
0,Input.GetAxis(“Vertical”) );
// find vector to the mouse
tempVector2 = new Vector3(Screen.width * 0.5f,0,Screen.height *
0.5f); // the position of the middle of the screen
tempVector = Input.mousePosition;
// find the position of the moue
on screen
tempVector.z = tempVector.y; // input mouse position gives us 2D coordinates, I am moving the Y coordinate to the Z coorindate in temp Vector and setting the Ycoordinate to 0, so that the Vector will read the input along the X (left and right of screen) and Z(up and down screen) axis, and not the X and Y (in and out of screen) axis
tempVector.y = 0;
Debug.Log(tempVector);
inputRotation = tempVector - tempVector2; // the direction we want face/aim/shoot is from the middle of the screen to where the mouse is pointing
}
void ProcessMovement()
{
rigidbody.AddForce (inputMovement.normalized * moveSpeed * Time.deltaTime);
transform.rotation = Quaternion.LookRotation(inputRotation);
transform.eulerAngles = new Vector3(0,transform.eulerAngles.y + 180,0);
transform.position = new Vector3(transform.position.x,0,transform.position.z);
}
I put in a lot so you can look through it.
PLEASE HELP!!!