Download

2D Side-scrolling Shooter Help

Hi Unreal Community,

I am fairly new to Unreal Engine 4 and I am attempting to create a small project, the idea is to make a blueprint that allows the user to use the arrow keys to aim a projectile weapon while progressing through a 2D level.

I have tried looking at the few examples including the twin stick shooter and 2D platformer packs but so far I am confused as to how I can get the twin stick shooter mechanics to work on the 2D platformer example framework, can anyone help shed some light on how I can do this in blueprint please?

Thank you very much.

After further messing around with the 2D example and First Person Examples I have got half of the basics working, but I am just having a problem with keeping the projectiles spawning the same way that the pawn is facing now.

Here is my Blueprint setup…

Tutorial made Reticle
f0ca05a11209a89035e3842340ec60e27f040a5f.jpeg

Projectile Spawning
8249408633e5b02bb7e8c27ff6f88ac1968c4b92.jpeg

Stick and mouse input are borrowed from the First Person example and Jump and Movement Inputs are borrowed from the Side Scroller Example Blueprints.

The resulting problem I now have is in this video below…

I wish for the projectiles to fire on the same axis the pawn is facing similar to older games like Contra and I was wondering if someone could help solve this last little problem.

Have you tried using the ‘Get Forward Vector’ method?

Yea I have tried that, problem now is it fires forward and not up or diagonal, so its half fixed, not sure how to fix the axis lock now…

The forward vector will do only that, forward :smiley: to use the pitch you have to use the view rotation I guess and take into account it’s pitch value.

Hi Moodydata,

Did you lock the axis on the relative rotation of the player or did you do so in world rotation?

Hi.

Its pretty straight fwd.

Get world location , Get world rotation -> Make transfrom

That works for me.

Just note to simply my life i created a simple box volume on my weapons to act as a socket just in front of the barrels.
I get that sockets location and rotation and then make a transform from that.

FWD vector gave me headaches due to what you described earlier.

No I did not, how do I go about doing that?