after implementing the fix recomendedby Guidanel i now have this error error CS0019: Operator +=' cannot be applied to operands of type UnityEngine.Quaternion’ and `int’ at lines 55 and 61 of this script
using UnityEngine;
using System.Collections;
public class movecamera : MonoBehaviour {
public int edgeboundry = 10;
public int minheight;
public int maxheight;
bool minheightreached;
bool maxheightreached;
public int rotspeed;
void Awake ()
{
minheightreached = false;
maxheightreached = false;
}
void Update ()
{
minheightreached = transform.position.y <= minheight;
maxheightreached = transform.position.y >= maxheight;
if (Input.GetAxis ("Vertical") < 0 * Time.deltaTime){
transform.position += new Vector3 (0, 0, -0.2f);
}
if (Input.GetAxis ("Vertical") > 0 * Time.deltaTime){
transform.position += new Vector3 (0, 0, 0.2f);
}
if (Input.GetAxis ("Horizontal") < 0 * Time.deltaTime){
transform.position += new Vector3 (-0.2f, 0, 0);
}
if (Input.GetAxis ("Horizontal") > 0 * Time.deltaTime){
transform.position += new Vector3 (0.2f, 0, 0);
}
if (Input.GetKey("q") || (Input.GetMouseButtonDown(2))){
transform.rotation += rotspeed;
}
if (Input.GetKey("e") || (Input.GetMouseButtonDown(2))){
transform.rotation += -rotspeed;
}
if(Input.GetAxis("Ymovement") > 0.0f && (maxheightreached == false))
{
transform.position += new Vector3(0, 0.2f, 0);
}
if(Input.GetAxis("Ymovement") < 0.0f && (minheightreached == false))
{
transform.position += new Vector3(0, -0.2f, 0);
}
}
}
could someone advise me on what im doing wrong thanks in advance
You put too many parenthesis.
if (Input.GetKey("q")) || (Input.GetMouseButtonDown("2"))
should be
if (Input.GetKey("q") || Input.GetMouseButtonDown("2"))
same for the following if statement.