// Use this for initialization void Start() { gameStarted = false; rend = this.GetComponent <Renderer>(); phb = this.transform.parent.GetComponent <PlayerHitBox>(); rend.material = mat[0]; }
private PlayerHitBox playersDamageScript; //is the hitbox script attached to the players spine void Start() { playerHP = InitialHP; //sets players hp rbody = GetComponent <Rigidbody> (); //is rigidbody componenet of player playerAnim = GetComponent <Animator> (); //is animator componenet of player rbody.freezeRotation = true; //stops any rotation done from physics engine playersDamageScript = GameObject.Find("/Player/Hips/Spine").GetComponent <PlayerHitBox>(); //access the script attached to players spine, and all of its variables capCollider = GetComponent <CapsuleCollider>(); //players range that the zombie can sense }
private void OnTriggerEnter2D(Collider2D collision) { PlayerHitBox hitbox = collision.GetComponent <PlayerHitBox>(); if (hitbox != null) { hitbox.TakeDamageAndBuffering(damage); } }
// Start is called before the first frame update void Start() { groundLayer = LayerMask.GetMask("Ground"); wallLayer = LayerMask.GetMask("Wall"); enemyLayer = LayerMask.GetMask("Enemy"); initialPlayerWalkSpeed = playerWalkSpeed; initialPlayerRunSpeed = playerRunSpeed; pushLeft = new Vector2(-pushForce, 0); pushRight = new Vector2(pushForce, 0); hitBox = GetComponentInChildren <PlayerHitBox>(); }
private void Start() { hitBox = GameObject.Find("Player").GetComponent <PlayerHitBox>(); hCal = GameObject.Find("HeightCalibrator").GetComponent <HeightCalibrator>(); if (leftHand == true) { hand = SteamVR_Input_Sources.LeftHand; } else { hand = SteamVR_Input_Sources.RightHand; } // Get the wand info for when we force close menuInterations[0] = this.transform.parent.Find("Controller (left)").GetComponent <WandControlMenuInteraction>(); menuInterations[1] = this.transform.parent.Find("Controller (right)").GetComponent <WandControlMenuInteraction>(); pausePos = new Vector3(.1f, .15f, -.15f); pauseRot = new Vector3(-45, 180, 0); }
// Start is called before the first frame update void Start() { rb = GetComponent <Rigidbody2D>(); sr = GetComponent <SpriteRenderer>(); anim = GetComponent <Animator>(); ps = GetComponent <PlayerShadow>(); phb = hitBox.GetComponent <PlayerHitBox>(); aso = GetComponent <AudioSource>(); h = 0; moveCam = true; direction = 1; temp_speed = speed; temp_speed2 = speed * 3; DashCooldown = false; dash_cooldown = dashTimeCoolDown; onetimehit = false; hit_time = 0.6f; canJump = true; jump_Count = 1; inair = false; health = 100; }
void Start() { ph = transform.parent.GetComponent <PlayerHitBox>(); switch (dirc) { case dir.buttom: forceDir = new Vector3(0, -1); break; case dir.left: forceDir = new Vector3(-1, 0); break; case dir.right: forceDir = new Vector3(1, 0); break; case dir.top: forceDir = new Vector3(0, 1); break; case dir.right_top: forceDir = new Vector3(0.5f, 0.5f); break; case dir.right_buttom: forceDir = new Vector3(0.5f, -0.5f); break; case dir.left_top: forceDir = new Vector3(-0.5f, 0.5f); break; case dir.left_buttom: forceDir = new Vector3(-0.5f, -0.5f); break; } }