using UnityEngine;
using System.Collections;
public class BulletMod : MonoBehaviour {
private float lifeTIme;
private GameObject Objectcenter;
public GameObject bullet;
void maxBulletLife()
{
lifeTIme += Time.deltaTime;
if (lifeTIme >= 5.0f)
{
Destroy(this.gameObject);
lifeTIme = 0.0f;
}
}
void bulletFIRE()
{
Objectcenter = GameObject.FindGameObjectWithTag ("Circleshot");
if (bullet != null)
{
GameObject objCen = Objectcenter;
Vector3 centerPos = objCen.transform.position;
rigidbody.centerOfMass = objCen.transform.position;
rigidbody.AddForce(transform.position - centerPos,ForceMode.Force);
}
}
// Update is called once per frame
void Update ()
{
maxBulletLife ();
bulletFIRE ();
}
}
That’s currently what happens, The object in front is what I want the result to be, which it does, but the objects in the back aren’t doing what the object in front is.
1- The objects in the back are instantiated objects.
2- The object in front starts to follow the same pattern as the objects in the back if it is moved.
3- I have a Rigidbody attached to the Bullet object, gravity is disabled, and Translate(Z) is frozen.
EDIT: Changed the code a bit, it looks a lot better this way, but again it only seems to want to effect the front object.
Is there a way I can make it effect all the objects in the scene?
And it fix’d it for the object already in the scene, I can now move it and the other objects with be sent in the correct direction,
But the objects that are instantiated are still having the same issue.

