Rotate a capsule trace along two axes (Z, Y)

Hi,

I’m trying to create a radial capsule trace with an additional angle on the Y axis. I’m drawing a semicircle of five equally spaced traces along the Z Axis forward from the player.


However, when I try to add a 45 degree angle upwards, I get the following.


I think I understand why this happens. GetActorForwardVector describes rotation along ZY, and for the actor on the right Y is a negative value. So when I add 45 degrees to it, the angle moves in a negative direction.

That’s said, I’m not sure how to fix it :smile:. The rotation should be relative to the actor, so using the up direction in world space doesn’t satisfy my requirements. I know there’s a right way to do this and it’s probably simple. I’m just a bit unfamiliar with Unreal in general and vector math isn’t always my strong suit (yet).

Thanks in advance! I’m sure this will be helpful to others just starting out.

1 Like

No, I think it’s correct. Despite the fact that I seem to be simultaneously plotting in local and world space :slight_smile:

rotations

2 Likes

Ah! This is exactly what I was looking for. I was struggling with how to combine multiple rotations, but this makes it clear and simple. Thanks for taking the time to point me in the right direction!

1 Like