Question by
Kerchak · Dec 09, 2015 at 10:34 PM ·
unexpectedchar
How Do I Fix Unexpected Char 0x201C? (Code Below)
#pragma strict
var animator : Animator; //stores the animator component
var v : float; //vertical movements
var h : float; //horizontal movements
var sprint : float;
function Start () {
animator = GetComponent(Animator); //assigns Animator component when we start the game
}
function Update () {
v = Input.GetAxis("Vertical");
h = Input.GetAxis("Horizontal");
Sprinting();
}
function FixedUpdate () {
//set the "Walk" parameter to the v axis value
animator.SetFloat ("Walk", v);
animator.SetFloat ("Turn", h);
animator.SetFloat("Sprint", sprint);
}
function Sprinting () {
if(Input.GetButton(“LeftControl”)) {
sprint = 0.2;
}
else {
sprint = 0.0;
}
}
Comment
Best Answer
Answer by tanoshimi · Dec 10, 2015 at 12:19 AM
The error message should have given you a line number. Glancing over your code, I'd say your speech marks are funky:
if(Input.GetButton(“LeftControl”)) {
Should be
if(Input.GetButton("LeftControl")) {