using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
public float moveSpeed;
private Animator anim;
// Use this for initialization
void Start()
anim = GetComponent();
{
// Update is called once per frame
void Update() {
{
if (Input.GetAxisRaw("Horizontal") > 0.5f || Input.GetAxisRaw("Horizontal") < -0.5f)
{
transform.Translate(new Vector3(Input.GetAxisRaw("Horizontal") * moveSpeed * Time.deltaTime, 0f, 0f));
}
if (Input.GetAxisRaw("Vertical") > 0.5f || Input.GetAxisRaw("Vertical") < -0.5f)
{
transform.Translate(new Vector3(0f, Input.GetAxisRaw("Vertical") * moveSpeed * Time.deltaTime, 0f));
}
anim.SetFloat("MoveX", Input.GetAxisRaw("Horizontal"));
anim.SetFloat("MoveY", Input.GetAxisRaw("Vertical"));
}
}
Can't seem to figure it out, new to this coding thing. the error is
**Severity Code Description Project File Line Column Category Source Suppression State
Error Unexpected symbol `=' in class, struct, or interface member declaration Solution 'Project mobile' (1 project) Assets/Scripts/PlayerController.cs 12 14 IntelliSense
**
↧