void OnTriggerStay(Collider col) { inWind = IN_WIND.IN; // Replace get component ??? gc = col.GetComponent <GlideController>(); if (gc != null) { if (forceApplication == FORCE_APPLICATION.INSTANT) { gc.WindVelocity = windIntensity * transform.right; // high +ve values = high tailwind, high -ve = headwind, zero = wind is side-on float tailwind = Vector3.Dot(gc.transform.forward, transform.right) * windIntensity; //gc.acceleration += tailwind * Time.deltaTime * boostPercentage; gc.acceleration += tailwind * Time.deltaTime; //Debug.Log(gc.acceleration); } else if (forceApplication == FORCE_APPLICATION.SLOWLY) { if (wind < windIntensity) { wind++; } gc.WindVelocity = wind * transform.right; // high +ve values = high tailwind, high -ve = headwind, zero = wind is side-on float tailwind = Vector3.Dot(gc.transform.forward, transform.right) * wind; //gc.acceleration += tailwind * Time.deltaTime * boostPercentage; gc.acceleration += tailwind * Time.deltaTime; //Debug.Log(wind); } else if (forceApplication == FORCE_APPLICATION.QUICKLY) { if (wind < windIntensity) { wind += 3; } gc.WindVelocity = wind * transform.right; // high +ve values = high tailwind, high -ve = headwind, zero = wind is side-on float tailwind = Vector3.Dot(gc.transform.forward, transform.right) * wind; //gc.acceleration += tailwind * Time.deltaTime * boostPercentage; gc.acceleration += tailwind * Time.deltaTime; //Debug.Log(wind); } } }
// Use this for initialization void Start() { glide = GetComponent <GlideController>(); rb = GetComponent <Rigidbody>(); }
// Use this for initialization void Start() { gc = GetComponent <GlideController>(); }
// Use this for initialization void Start() { glide = GetComponent <GlideController>(); h = GetComponent <Health>(); }
// Use this for initialization void Start() { glide = target.transform.parent.gameObject.GetComponent <GlideController>(); }