So I have been trying very hard and so incredibly stuck on something that I think is so simple.
I want a bullet to shoot from the direction my character is facing. The character moves in 8-directions but with custom movement, not the original arrow keys. Also the character has a different animation that plays based on the direction he is going.
However every time I hit the command assigned to shoot, the bullet always goes right.
I have tried so many things and it seems like not matter what the system can not get my characters angle. I have the "set angle" for 8-direction off, as well as the bullet behavior, and have tried different combinations with no luck. I have looked around on the forums and tried the solutions found here and nothing worked, mostly because a lot of the results were geared to a platform setting. I have tried making an instance variable "previousx and PreviousY" and set for every tick to set them as the character's X and Y then using that variable to determine the characters angle of motion then setting the bullets angle to that and still it just goes right.
I am sure that I could set a variable to assign direction with every key I have assigned for new movement, but that seems overly redundant.
I did try setting bullet angle to angle(character.x, character.y, mouse.x, mouse.y) This worked in setting the angle but I really want the bullet to go from the characters direction, not to mention then the bullet follows the mouse and that's just silly.
I would love to just set the bullets angle of motion to the characters angle, like character.angle, but no matter what it never seems to have his actual angle and I don't know why.
I know this has to be something so simple that I just haven't thought of yet.