private void Fire() { GameObject clone = Instantiate(ball, transform.position, Quaternion.identity); float shootAngle = this.transform.localEulerAngles.z; shootAngle += 90; Vector3 startForce = CircleUtility.PointOnCircle(shootMagnitude, shootAngle); clone.GetComponent <Rigidbody>().AddForce(startForce); }
// Update is called once per frame void Update() { if (points.Length != numberOfParticles || points == null) { CreatePoints(); } for (int i = 0; i < numberOfParticles; i++) { Vector3 pos = points[i].position; pos = CircleUtility.PointOnCircle(radius, speed * Time.time + i); points[i].position = pos; } myParticleSystem.SetParticles(points, points.Length); }