Hi guys, iv been looking at this for a while but I cant seem to see it
Im getting an error for line 32, 34, 39 and 41 for “false”
this was a JS scripted but I tried to convert it to C# my self, could that be an issue?
Anyways please have a look if you have time and see if you can help me
Thanks
using UnityEngine;
using System.Collections;
public class Lean : MonoBehaviour {
public float leanLeft;
public float leanRight;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetButtonDown ("Lean Left")) {
doLeanLeft ();
}
if (Input.GetButtonDown ("Lean Right")) {
doLeanRight ();
}
if (Input.GetButtonUp ("Lean Left")) {
doLeanBack ();
}
if (Input.GetButtonUp ("Lean Right")) {
doLeanBack ();
}
}
void doLeanLeft()
{
if (leanLeft = false) {
transform.rotation = Quaternion.Euler(0,0,30);
leanLeft = false;
}
}
void doLeanRight ()
{
if (leanRight = false) {
transform.rotation = Quaternion.Euler(0,0,-30);
leanRight = false;
}
}
void doLeanBack()
{
transform.rotation = Quaternion.Euler(0,0,0);
}
}