添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Hey there,
How’s it going?

Well, I’m making my first 2D platform game and it is going well so far,
but I got this error and it is disturbing me for real… I hope someone can help me,
cause it’s very boring.

The error says:
Parameter ‘Jump’ does not exist.
UnityEngine.Animator:SetBool(String, Boolean)
Player:Jump() (at Assets/Pixel Adventure 1/Assets/Scripts/Player.cs:64)
Player:Update() (at Assets/Pixel Adventure 1/Assets/Scripts/Player.cs:28)

It says that is something wrong with my Player’s Scripts…
here’s the code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour
    public float Speed;
    public float JumpForce;
    public bool isJumping;
    public bool doubleJump;
    private Rigidbody2D rig;
    private Animator anim;
    // Start is called before the first frame update
    void Start()
        rig = GetComponent<Rigidbody2D>();
        anim = GetComponent<Animator>();
    // Update is called once per frame
    void Update()
        Move();
        Jump();
    void Move()
        Vector3 movement = new Vector3(Input.GetAxis("Horizontal"), 0f, 0f);
        transform.position += movement * Time.deltaTime * Speed;
        if (Input.GetAxis("Horizontal") > 0f)
            anim.SetBool("walk", true);
            transform.eulerAngles = new Vector3(0f, 0f, 0f);
        if (Input.GetAxis("Horizontal") < 0f)
            anim.SetBool("walk", true);
            transform.eulerAngles = new Vector3(0f, 180f, 0f);
        if (Input.GetAxis("Horizontal") == 0f)
            anim.SetBool("walk", false);
    void Jump()
        if (Input.GetButtonDown("Jump"))
            if (!isJumping)
                rig.AddForce(new Vector2(0f, JumpForce), ForceMode2D.Impulse);
                doubleJump = true;
                anim.SetBool("Jump", true);
                if (doubleJump)
                    rig.AddForce(new Vector2(0f, JumpForce), ForceMode2D.Impulse);
                    doubleJump = false;
            rig.AddForce(new Vector2(0f, JumpForce), ForceMode2D.Impulse);
    void OnCollisionEnter2D(Collision2D collision)
        if (collision.gameObject.layer == 8)
            isJumping = false;
            anim.SetBool("jump", false);
    void OnCollisionExit2D(Collision2D collision)
        if (collision.gameObject.layer == 8)
            isJumping = true;

Perhaps this is true, but this is NOT what it is saying.

Read the error carefully. It is saying that when you try to say SetBool( "Jump", true); your animator has not been set up to have a boolean property named “Jump”.

Go back to the tutorial or guide where all this started from and make sure you don’t skip the part where they have you set up the animator. In Unity code is almost never alone in a vacuum, and almost always interoperates with other assets and systems, in this case the Animator found on this GameObject during the Start() function’s execution phase.

Perhaps this is true, but this is NOT what it is saying.

Read the error carefully. It is saying that when you try to say SetBool( "Jump", true); your animator has not been set up to have a boolean property named “Jump”.

Go back to the tutorial or guide where all this started from and make sure you don’t skip the part where they have you set up the animator. In Unity code is almost never alone in a vacuum, and almost always interoperates with other assets and systems, in this case the Animator found on this GameObject during the Start() function’s execution phase.

Just solved it, the problem was that I have switched “jump” to “walk” on 2 conditions… silly mistake lol
Thx anyway :slight_smile:

Do you know what this error means? I googled it, but didn’t find a solution…
A guy told me it is just an engine glitch and there’s nothing to worry about, but
I don’t like to see alerts on my Console…

The alert says:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Graphs.Edge.WakeUp () (at <732b665a0eb44a80b9931c01ad63f8b8>:0)
UnityEditor.Graphs.Graph.DoWakeUpEdges (System.Collections.Generic.List1[T] inEdges, System.Collections.Generic.List1[T] ok, System.Collections.Generic.List`1[T] error, System.Boolean inEdgesUsedToBeValid) (at <732b665a0eb44a80b9931c01ad63f8b8>:0)
UnityEditor.Graphs.Graph.WakeUpEdges (System.Boolean clearSlotEdges) (at <732b665a0eb44a80b9931c01ad63f8b8>:0)
UnityEditor.Graphs.Graph.WakeUp (System.Boolean force) (at <732b665a0eb44a80b9931c01ad63f8b8>:0)
UnityEditor.Graphs.Graph.WakeUp () (at <732b665a0eb44a80b9931c01ad63f8b8>:0)
UnityEditor.Graphs.Graph.OnEnable () (at <732b665a0eb44a80b9931c01ad63f8b8>:0)

Normally this means you didn’t set something up and it is a super-common error.

But looking where this one is coming from (the lines below it, the call stack), it appears this one is happening entirely internal to Unity.

This came up in Google:

https://discussions.unity.com/t/579827

Kurt-Dekker:

Normally this means you didn’t set something up and it is a super-common error.

But looking where this one is coming from (the lines below it, the call stack), it appears this one is happening entirely internal to Unity.

This came up in Google:

https://discussions.unity.com/t/579827

Got it!
Thx for helping me

Perhaps this is true, but this is NOT what it is saying.

Read the error carefully. It is saying that when you try to say SetBool( "Jump", true); your animator has not been set up to have a boolean property named “Jump”.

Go back to the tutorial or guide where all this started from and make sure you don’t skip the part where they have you set up the animator. In Unity code is almost never alone in a vacuum, and almost always interoperates with other assets and systems, in this case the Animator found on this GameObject during the Start() function’s execution phase.

Thank you so much I was losing my shit until I found your answer.

Hello !
I Had the same problem and i solved it, it seems that the engine has a bug, so what i did was to RENAME the parameter in the animator for PlayerJumping, i continued using boolean parameter and the MOST IMPORTANT thing i
UNASSIGNED the animator controller of the player and then i assigned again. Thats it, now’s working