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: :slight_smile:](https://emoji.discourse-cdn.com/google/slight_smile.png?v=12)
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.List
1[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