Question by
Spacetato · Nov 21, 2015 at 07:10 AM ·
c#controllerparsingparsing error
error cs8025 parsing error?
This is my script:
using UnityEngine;
using System.Collections;
public class DemoControlScript : MonoBehaviour {
private Animator myAnimator;
void Start () {
myAnimator = GetComponent<Animator>();
}
void Update () {
myAnimator.SetFloat ("VSpeed", Input.GetAxis ("Vertical"));
}
}
if(Input.GetKey("q")){
if((Input.GetAxis ("Vertical") == Of) && (Input.GetAxis ("Horizontal") == 0)){
myAnimator.SetBool ("TurningLeft", true);
}
} else {
myAnimator.SetBool ("TurningLeft", false);
}
if(Input.GetKey("e")){
if(Input.GetAxis ("Vertical" == Of) && (Input.GetAxis ("Horizontal") == 0)){
myAnimator.SetBool ("TurningRight", true);
}
} else {
myAnimator.SetBool ("TurningRight", false);
}
I don't know what to do. I've made sure I have }
Comment
Answer by meat5000 · Nov 21, 2015 at 10:43 AM
if((Input.GetAxis ("Vertical") == Of)
You obviously mean 0f
not Of
. Zero not the letter O.
Your answer
Follow this Question
Related Questions
JSON parse error 0 Answers
help to connect two objects together 0 Answers
Some problems with handmade basic player controller 0 Answers
The code does not work in unity 0 Answers
How to fix this parsing error? 2 Answers