Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Unexpected symbol "if"

$
0
0
I was trying to do a mouselook script when it happened.Here is the script. public class MouseLook : MonoBehaviour { Vector2 mouselook; Vector2 smoothV; public float sensitivity = 5.0f; public float smoothing = 2.0f; GameObject character; // Use this for initialization void Start () { character = this.transform.parent.gameObject; } // Update is called once per frame void Update () { var md = new Vector2 (Input.GetAxisRaw ("Mouse X"), Input.GetAxisRaw ("Mouse Y")); md = Vector2.Scale(md, new Vector2(sensitivity * smoothing,sensitivity * smoothing)); smoothV.x = Mathf.Lerp(smoothV.x, md.x, if / smoothing); smoothV.y = Mathf.Lerp(smoothV.y, md.y, if / smoothing); MouseLook += smoothV; MouseLook.y = Mathf.Clamp(MouseLook.y,-90f,90f); transform.localRotation = Quaternion.AngleAxis(-MouseLook.y, Vector3.right); character.transform.localRotation = Quaternion.AngleAxis(MouseLook.x, character.transform.up); } } .,

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>