Download

How do you create a relative rotation vector?

Hi guys. So in my game, I’m going to be firing three projectiles when fire is pressed, kind of like a shotgun. One of them has to move in the line in which my player is currently rotated. The other two have to spawn at the same spot and be spread out at 45 degree angles from the centre i.e. my player’s rotation vector, so one of them has to be fired at 45 degrees less than my main projectile, and the other has to be fired at 45 degrees more than my main projectile.
I tried implementing this via a Blueprint, and I’ve just added 2 projectiles as of now. The one that has to fire straight is working fine, but the second one keeps firing in just one singular direction, no matter which way my character is facing. I’ve attached an image of the relevant part of my Blueprint logic. I haven’t attached any other node to avoid clutter. All I’m doing after the Make Transform node is plugging it into a Spawn Actor from Class node.
Any help would be appreciated. I’m still pretty new to Blueprinting, and might have misunderstood how vectors work, so please correct me where I’m wrong.

By rotating a vector by 45 degrees, I’m assuming that you’re referring to the change in Yaw in local space. If that’s the case, you can use the RotateVectorAroundAxis node, with your forward vector as In Vect & your character’s Up Vector as the Axis.

Hey, that helped! Thanks a lot! I couldn’t figure out how to fetch the axis to rotate around, so your answer was the perfect solution!