Shooting back and forth in a 2d platformer

Hi, I recently just picked up Unity and decided to do a simple 2d platformer to understand Unity and brush up on my programming. Now here’s my problem:

Im trying to shoot forward if the character is facing forward and have the projectile move forward but if the character is facing the other direction, instantiate it from that direction and move that forward. I thought I had it with:

new var direction = new Vector3(Input.GetAxis(“Horizontal”),0,0);
if(direction == 1)
instantiate
else
instantiate the other way as -1 would be the other way.

Problem I have with this is it just stays there and I tried adding a transform.position.x *= value but nothing :frowning:

Any thoughts?

I had this problem too. Just make an empty gameobject and parent it to your character, and have it spawn at the transform point of the gameobject. Hope that helps!

-Blayke