How to move instantiate position

i’m trying to make a space shooter following differents tutorial on internet and trying to code myself a little bit

i want to make my shot spawn a little on the left of the player’s ship
like it’s shot from a canon on the wing

but when i want to instantiate i can’t put myTransform.position.x + 2

for exemple +2 will move the instantiate position a little bit and so i can create another shot from the other wing

but i can’t get it to work

here’s my script i cut off the pointlesses parts

if someone could help me :frowning:

since i can’t post my code without bugs i screened my monodevelop

I’d suggest having 2 child gameobjects on the spaceship. Each is positioned at each wing (call them leftWing and rightWing). Then instead of using

Instantiate(Laser, myTransform.position, Quaternion.Identity);

use

Instantiate(Laser, leftWing.transform.position, Quaternion.identity);
Instantiate(Laser, rightWing.transform.position, Quaternion.identity);