Hello all, currently I have an instantiatyed bullet that is created as such:
GameObject bullet = (GameObject)Instantiate (Bullets, point, NormalCamera.gameObject.transform.rotation );
bullet.transform.forward = NormalCamera.transform.forward;
This issue is that when I instantiate the bullet the bullet is firing at correct angle/direction.
However, I store a bunch of data in a Vector Array that alters the flight of the bullet.The vector array takes control of the bullet immediately (which is what I want) What math would I use to ensure that bullet continues to fly in its instantiated direction but updates with my vector array data? Currently the bullet only flys on the x axis?
void CreateVectorArray (int x)
{
positions = new Vector3[x];
positions[0] = this.gameObject.transform.position;
for(int i = 1; i < x-1; i++)
{
positions[i].x = positions[i-1].x + (float)ptr[0,i] - (float)ptr[0,i-1];//yards
positions[i].y = positions[i-1].y + ((float)ptr[10,i] + (float)ptr[10,i-1])*0.0277778f;//inches
positions[i].z = positions[i-1].z + ((float)ptr[ 4,i] + (float)ptr[ 4,i-1])*0.0277778f;//inches
}
}