Get Axis between two vectors in UE5

Hi,

I’m trying to create a ‘circle’ of line traces from a point and having issues with the ‘Rotate Vector Around Axis’ part. I see success manually setting the ‘axis’ field to a static value on that axis, but can’t figure out how to get the axis to rotate around from the two existing vectors (the player and ahead of them).

Any help would be appreciated.

Thanks :slight_smile:

Hi Tom,

I replaced ‘Add Instance’ with ‘Draw Debug Point’ in this code snippet and was able to create points in a circle. (but with static axis like you mentioned)

You are trying to rotate this circle of traces freely?

Welcome to the forums!

Hi,

Thanks for the response. Yeah, the aim is they’re coming from the player to where they’re looking. The blueprint I have is working and generates the points I want minus the axis. Maybe there’s a better way to approach the issue than the rotate vector around axis block.

Need a way to calculate the axis on this block from the player vector and the initial forward vector calculated from the player.

image

Thanks

Could you share what you have or perhaps an image illustrating what you want? It’s not clear what is the result you are after(at least not for me).

Could you share what you have or perhaps an image illustrating what you want? It’s not clear what is the result you are after(at least not for me).
[/quote]

Sure thing, sorry about that!

Currently have this bp

When putting in a manual axis, I can create this which is exactly what I’m looking for, but I need the axis to reflect where the player is actively looking.

Hope this helps a bit

If I understood correctly: you want an actor to look at where player is looking, and this actor will trace in a cone in that direction. Right?

Something like this (bit 1st person… it’s the same in this case):
LookAtConeTrace

If so, this might help:

1 Like

This worked wonders, thank you so much!

1 Like