0
\$\begingroup\$
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour {

    public float moveSpeed;

    public Animator anim;

// Use this for initialization
void Start () {
    anim = GetComponent<Animator>();
}

// 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("MoxeX", Input.GetAxisRaw ("Horizontal"));
        anim.SetFloat("MoxeY", Input.GetAxisRaw ("Vertical"));

        }
    }

I an trying to run this with a basic 2D animation in unity personal and I keep getting Warning! - Parameter "MoveX" does not exist and Parameter "MoveY" does not exist but it is clearly in the animator as a float.

\$\endgroup\$
2
  • \$\begingroup\$ Could you include a screenshot of your animator window? Are you sure MoveX and MoveY are spellwd the same way as in the animator? \$\endgroup\$
    – user100681
    Nov 29, 2017 at 17:52
  • 2
    \$\begingroup\$ In your code, you are passing "MoxeX" and "MoxeY" not "MoveX" or "MoveY" \$\endgroup\$ Nov 29, 2017 at 17:53

1 Answer 1

1
\$\begingroup\$

You typoed. MoxeX instead of MoveX, and MoxeY instead of MoveY

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .