Fixed. Found that you can create an empty GameObject and place the projectile as a child then create a prefab from that with the correct rotation. I wish you could simply change the rotation of the x, y or z axis on an object without rotating the object.
I’ve spent a lot of hours on this issue, researching, asking questions and watching videos.
There is a an Empty GameObject attached to the ship on all four turrets. These are called turretLB, turretLT, etc (left bottom, left top). These GameObjects are attached to the script in the inspector. This is the instantiation script as it currently exists:
Instantiate(laserLBPrefab, turretLB.position, turretLB.transform.rotation);
Instantiate(laserLTPrefab, turretLT.position, turretLT.transform.rotation);
Instantiate(laserRBPrefab, turretRB.position, turretRT.transform.rotation);
Instantiate(laserRTPrefab, turretRT.position, turretRT.transform.rotation);
On the prefab there is a script to move the projectile forward:
transform.Translate(transform.forward * maxSpeed * Time.deltaTime, Space.World);
I had to add Space.World to get it to move forward in the correct direction, though I am confused as to why you use World coordinates and not Local.
The issue is that the prefab projectile comes out at a 90 degree angle pointing straight up. Changing the rotation of the Empty GameObject (turretLB, turretLT, etc) has no effect.
Any suggestions? I’ve tried dozens of things to fix this.