void CrashBike() { foreach (GameObject comp in bikeComponents) { BoxCollider boxCol = comp.GetComponent <BoxCollider>(); Rigidbody rigby = comp.GetComponent <Rigidbody>(); if (boxCol == null) { comp.AddComponent <BoxCollider>(); } if (rigby == null) { comp.AddComponent <Rigidbody>(); } } //disable dust particles && move controls try{ GameObject dust = GameObject.Find("Dust"); dust.SetActive(false); catMove kitty = this.GetComponent <catMove>(); kitty.enabled = !kitty.enabled; } catch (NullReferenceException e) { Debug.Log("-"); } invisibleGround.SetActive(true); if (crashAnimationPlayed == 0) { camAnim.SetTrigger("bikeCrash"); } crashAnimationPlayed = 1; Oof(); }
//float groundValue = 0f; // Start is called before the first frame update void Start() { player = GameObject.FindGameObjectWithTag("Player"); cat = GameObject.FindObjectOfType <catMove>(); }
// Start is called before the first frame update void Start() { animator = GetComponent <Animator>(); bikeReference = GameObject.FindObjectOfType <catMove>(); }