private void CreateArrow() { ArrowBase arrow = _arrowFactory.CreateArrow <Arrow>(); arrow.transform.position = _arrowStartPosition.position; ShotArrow(arrow); }
// Use this for initialization void Start() { hand = FindObjectOfType <ArrowHand>(); notchObj = transform.GetChild(0); lr = GetComponent <LineRenderer>(); lr.SetVertexCount(51); nocked = null; src = gameObject.AddComponent <AudioSource>(); }
void Release() { AudioSource.PlayClipAtPoint(shootSounds[Random.Range(0, shootSounds.Length)], transform.position); nocked.GetComponent <Rigidbody>().isKinematic = false; Rigidbody rb = transform.root.GetComponent <Rigidbody>(); nocked.GetComponent <Rigidbody>().velocity = transform.forward * NockedPotentialVelocity(); //rb.velocity nocked.GetComponent <ArrowHoming>().target = target; nocked = null; }
void Nock(ArrowBase ab) { nocked = ab; }
private void ShotArrow(ArrowBase arrow) { arrow.Rigidbody.AddRelativeForce(1000, 0, 0); }