Projectile shot sideways

Hello, I’m following the twin stick shooter tutorial and I’ve successfully made my gun shoot. But I’m there is a problem when I shot sideways, or not shooting straight up or down.

As seen in the image above, the projectile is shooting sideways. I’ve tried following the video, but I can’t pinpoint where I’m making mistake.

video related: BP Twin Stick Shooter: Weapon Firing Behavior | 10 | v4.8 Tutorial Series | Unreal Engine - YouTube

Are you using the gun’s forward vector for the direction? Because as I can see in the screenshot the projectile follows the gun’s direction.

Try using the character’s forward vector instead.

The video didn’t do direction. I tried looking since I see people use vector nodes in their respective projectile setups. But here is how my weapon is set up in blueprint. Both itself and when it spawns with character.

Well yeah, you don’t set the projectile direction, of course it’s not going where you want it to go. In your setup the projectile direction totally depends on the SpawnPoint rotation, and since that’s attached to the gun, so on the gun rotation, and it fires exactly where the gun is pointed.

In the Spawn Projectile node: clear the Spawn Transform pin, right click it and Split it. Do the Same with the GetWorldTransform. Connect Location and Scale to each other, but as for Rotation, Get Character’s Rotation. Thus you’ll make the projectile shoot straight where the character is looking.

Got location and scale connected between GetWorldTransform and Spawn Projectile. How do I get Characters Rotation?

271397-rotat.png

I should’ve explained the context better: when I shoot up or down, the projectile shoots normal (green line). But when I shoot left or right, the projectile shoots sideways (green oval).

As for the proposed solution, it didn’t work. Projectiles still shoot sideways when looking left or right. Maybe I incorrectly connected something wrong?