This may be a dumb question, but I have a parsing error in anim.setFloat(“LastMoveY”, lastMove.y); I have no idea to fix. (42,55) Error CS8025: Parsing error (last one is 42,55). When I delete that line of code, I get another error in 41,55. There’s another parsing error if I delete that line as well. I need help.
using UnityEngine;
using System.Collections;
public class JimController : MonoBehaviour {
public float moveSpeed;
private Animator anim;
private bool playerMoving;
private Vector2 lastMove.x;
private Vector2 lastMove.y;
// Use this for initialization
void Start () {
anim = GetComponent<Animator>();
}
// Update is called once per frame
void Update () {
playerMoving = false;
if(Input.GetAxisRaw("Horizontal") > 0.5f || Input.GetAxisRaw("Horizontal") < 0.5f )
{
transform.Translate (new Vector3(Input.GetAxisRaw("Horizontal") * moveSpeed * Time.deltaTime, 0f, 0f));
playerMoving = true;
lastMove = new Vector2(Input.GetAxisRaw("Horizontal"), 0f);
}
if(Input.GetAxisRaw("Vertical") > 0.5f || Input.GetAxisRaw("Vertical") < -0.5f )
{
transform.Translate (new Vector3(0f, Input.GetAxisRaw("Vertical") * moveSpeed * Time.deltaTime, 0f));
playerMoving = true;
lastMove = new Vector2(0f, Input.GetAxisRaw ("Vertical"));
}
anim.SetFloat("MoveX", Input.GetAxisRaw("Horizontal"));
anim.SetFloat("MoveY", Input.GetAxisRaw("Vertical"));
anim.SetBool("PlayerMoving", playerMoving);
anim.SetFloat("LastMoveX", lastMove.x);
anim.SetFloat("LastMoveY", lastMove.y);