[SOLVED] Bullet Direction (no flip/top-down behavior)

Hi Community (noob here),

My Player sprite moves by custom keys WASD.


Ignore the shoot bullet code - i know it’s wrong!!!
My player has bullet behaviour but I can’t get it to shoot in the direction (for example)… If I press A key… and press SPACE… shoot left.

I’ve seen examples of flipping but I don’t think this is what I want to do.

I was also thinking… should I setup a var and this dictates the angle???

Thanks again,
Roberto

1st idk why you use forces
Go to behaviors and type remap
Now choose remap topdown

Why not just top down behavior?

Cause remap will automatically install topdown behavior
And remap allows you to remap your movement keys which by default should be WASD

NOW thx to topdown behavior you get access to condition angle of movement
PAY ATTENTION to icon
Cause there is same condition for forces
And one for topdown looks like

As you see i also set variable PlayerDirection to either left right up or down

And now based on these variables i can change animations or fire bullet toward whatever direction i want
I could split it into 2 variables one for up down and one for left and right
And now i could shove in moving and firing diagonally into it

BUT generally now i can check what is value of such variable and prepare 4 events for each value of that variable to shoot either left right up or down
Where i like to shot toward angle

And here you have angles
image

Now go and play around with all you read here
You will need some practice but believe NOTHING you gonna do what i wrote is hard or cryptic
Just don’t be afraid to mess around with it

WOW! Super thanks @ZeroX4

1 Like