Transform posistion of gameobject script is attachted to.

I have a bullet prefab that I continulously spawn and delete and when it’s spawned I want to add .5 to the x. I would prefer for this too be in C#.I have tried transform.posistion.x += .5;

Vector3 currPosition = transform.position;

void FixedUpdate(){
    currPosition.x += 0.5f;
    transform.position = currPosition;
}

One advice, If you are making a shooter game which uses automatic guns, you are better of pooling the bullet instead of destroying it, or raycast your bullet line. This will prevent performance issues later on.

Create a script and put on the prefab of the bullet:

void Start(){
transform.position.x += 0.5f;
}