public void Init() { anim = GetComponentInChildren <Animator> (); enTarget = GetComponent <EnemyTarget> (); enTarget.Init(anim); myBody = GetComponent <Rigidbody> (); agent = GetComponent <NavMeshAgent>(); myBody.isKinematic = true; a_hook = anim.GetComponent <AnimatorHook> (); if (a_hook == null) { a_hook = anim.gameObject.AddComponent <AnimatorHook>(); } a_hook.Init(null, this); ignoreLayers = ~(1 << 9); }
public void Init() { SetUpAnimator(); myBody = GetComponent <Rigidbody> (); myBody.angularDrag = 999; myBody.drag = 4; myBody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ; a_hook = activeModel.GetComponent <AnimatorHook> (); if (a_hook == null) { a_hook = activeModel.AddComponent <AnimatorHook>(); } a_hook.Init(this, null); gameObject.layer = 8; ignoreLayers = ~(1 << 9); anim.SetBool("onGround", true); ls_hook.CloseDamageColliders(); //in videos this is dealt with on inventory manager which i am not using d_hook.CloseDamageColliders(); g_hook.CloseDamageColliders(); }