Question by
Mega_Jimmy · Mar 02, 2016 at 08:17 PM ·
2danimator controllerboolean
My Animator and C-Sharp Bools won't work together?
Hey guys
So here's the deal, I'm trying to get my Idle animation for a character to play when he lands from a jump. However the main problem is that I can't get the Bool in Unity (C-Sharp) to associate with the Bool in the code. Where am I going wrong?
private bool grounded = true;
public Transform ground check;
void Awake () {
anim = GetComponent<Animator> ();
rb2d = GetComponent<Rigidbody2D> ();
groundcheck = transform.Find("groundCheck");
}
I'm using a RayCast to check whether or not my ground check is true, which passes the value to the bool.
grounded = Physics2D.Linecast (transform.position, groundcheck.position, 1 << LayerMask.NameToLayer ("Ground"));
But that's where it seems to stop. I'm legitimately stumped. Any suggestions?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612070339im_/https://answers.unity.com/themes/thub/images/avi.jpg)