Question by
ChibiChubbs · Apr 22, 2016 at 03:09 AM ·
error
How do I solve these errors?
Yet again, I get another error. Something was wrong with my game, so I played with the code a little bit...and BOOM, 13 errors. I have no idea how to fix this. Please help.
using UnityEngine;
using System.Collections;
public class JimController : MonoBehaviour
{
public float moveSpeed;
private Animator anim;
private bool playerMoving;
private Vector2 lastMove;
// 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);
}
}
Comment
Answer by gjf · Apr 24, 2016 at 06:59 PM
not sure why my answer from the other day didn't show up.
there's a missing semicolon on line 21.