public void Activate() { bikeBrain bb = owner.GetComponent <bikeBrain>(); bb.health = bb.totalHealth; bb.UpdateHealth(); }
// This works by measuring the distance to ground with a // raycast then applying a force that decreases as the object // reaches the desired levitation height. // The greater the thrust, the more hover power/height you need; // Vary the parameters below to // get different control effects. For example, reducing the // hover damping will tend to make the object bounce if it // passes over an object underneath. void Start() { // Fairly high drag makes the object easier to control. attackAngle = attackAngle / 2; rb = bike.GetComponent <Rigidbody>(); en = GetComponent <EnemyNavigation>(); player = GameObject.FindGameObjectWithTag("Player").GetComponent <bikeBrain>(); sword.SetActive(false); rb.drag = 0.5f; rb.angularDrag = 0.5f; boosting = false; attackCoroutineStarted = false; health = totalHealth; canSeePlayer = false; layerMask = 1 << LayerMask.NameToLayer("Terrain"); engineSoundSource.clip = engineSound; swordHitSource.clip = swordHit; swordSwingSource.clip = swordSwing; explosionSource.clip = explosion; engineSoundSource.Play(); }
private void Start() { menu = transform.Find("UI/Navigation").gameObject; player = GetComponent <bikeBrain>(); flavorText = transform.Find("UI/Flavor").gameObject.GetComponent <TextMeshProUGUI>(); }
public void Activate() { bikeBrain bb = owner.GetComponent <bikeBrain>(); bb.SetBoost(true, 10); }