having problems shooting in same direction as actor
Posted: Thu Sep 07, 2006 5:41 am
I have an actor that I want to shoot in the same direction it is facing.
I have it set up now for keydown right, changes animation to right, has x=x+2; in the script, and sets variable unit1pos=1.
The bullet has a creat actor of if unit1pos=1, then xvelocity=13;.
I have the same for left down and up.
The problem I have is going at an angle. On keydown right, up, all keys pressed, I have change animation for that direction and unit1pos=2.
I don't have to set x or y cordinates because when I press up which is y=y-2 and right which is x=x+2, it goes in the proper direction.
I have bullet with a create actor of unit1pos=2, then xvelocity=13 and yvelocity=-13.
But, now when I press right and up, my actor goes in the right direction, changes animation to the right one, but when I press spacebar, which creates bullet, it does nothing.
If I let off of right and up, the actor still faces in the correct direction, but when I press spacebar it shoots straight up.
Any thoughts?
I have it set up now for keydown right, changes animation to right, has x=x+2; in the script, and sets variable unit1pos=1.
The bullet has a creat actor of if unit1pos=1, then xvelocity=13;.
I have the same for left down and up.
The problem I have is going at an angle. On keydown right, up, all keys pressed, I have change animation for that direction and unit1pos=2.
I don't have to set x or y cordinates because when I press up which is y=y-2 and right which is x=x+2, it goes in the proper direction.
I have bullet with a create actor of unit1pos=2, then xvelocity=13 and yvelocity=-13.
But, now when I press right and up, my actor goes in the right direction, changes animation to the right one, but when I press spacebar, which creates bullet, it does nothing.
If I let off of right and up, the actor still faces in the correct direction, but when I press spacebar it shoots straight up.
Any thoughts?