how to shoot bullet strait on y-axis even player move???

I want always shoot bullet strait on y axis. My player moving on x axis, so the problem is then i move player along x axis bullet doesn’t go strait from bullet point. how to solve this ?

Depends. How are you firing the projectile?

If you’re applying force, Try setting the velocity of the projectile to 0, then adding for in the correct direction.

By default, as long as you’re not using AddRelativeForce your projectiles shouldn’t be inheriting any velocity.

If it’s not physics based movement, something like:

void Update() {

    projectile.transform.Translate(0, speed * Time.deltaTime, 0, Space.World);

It should keep the projectile in a straight line in y direction.