# How to change shooting directions?

**URL:** <https://forum.kirupa.com/t/how-to-change-shooting-directions/42533>\
**Category:** Uncategorized\
**Created:** [February 10, 2004, 3:04am UTC](https://forum.kirupa.com/t/how-to-change-shooting-directions/42533 "2004-02-10T03:04:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fargate](https://avatars.discourse-cdn.com/v4/letter/f/dbc845/32.png) [@Fargate](https://forum.kirupa.com/u/Fargate)\
**Post date:** [February 10, 2004, 3:04am UTC](https://forum.kirupa.com/t/how-to-change-shooting-directions/42533/1 "2004-02-10T03:04:03Z")

</div>

I have the following player control script

[AS]  
onClipEvent (enterFrame) {  
if (Key.isDown(Key.RIGHT)) {  
this.\_x += 5;  
this.play();  
this.\_xscale = 100  
} else if (Key.isDown(Key.LEFT)) {  
this.\_x -= 5;  
this.play();  
this.\_xscale = -100  
}  
}  
[/AS]

My Guy normally shoots to the right, so the problem is when he turns to the left it looks like he’s shooting out of his back. How can I make it so that when he turns to the left he shoots in that direction as well.

I already tried the below altered shooting script…no success

[AS]  
onClipEvent (load) {  
if(\_root.mario.\_xscale =100) {   
shellMoveSpeed = 10;  
this.\_x = \_root.mario.\_x+10;  
this.\_y = \_root.mario.\_y;  
} else if (\_root.mario.\_xscale = -100) {   
shellMoveSpeed = - 10;  
this.\_x = \_root.mario.\_x-10;  
this.\_y = \_root.mario.\_y;  
}  
}  
[/AS]

Dunno…any ideas on how to fix this???Thanks in advance :).

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 10, 2004, 8:13pm UTC](https://forum.kirupa.com/t/how-to-change-shooting-directions/42533/2 "2004-02-10T20:13:48Z")

</div>

crosspost
