I try to achieve something that I guess its pretty simple if you’ve taken your math class correctly, but currently I struggle a bit around this.
My setup is a 2.5D game, with auto attack made of projectiles that are shot in the direction of the mouse cursor position. Everything right now works fine, but I want to add an offset at the starting position of my projectile, to not start at the current actor location of my player character, but with a little offset from my actor location AND in the right direction (of my cursor mouse position).
So far, I have :
My cursor mouse position in screen
My Player Character Location
The rotation value from my Player Character to my Mouse Position
I guess that with these values we can easily calculate an offset of X in the desired direction, but I don’t know how.
I’ve tried to play with the Add Local Offset node but doesn’t work as intended
Are you rotating your actor while aiming/ is your projectile always going to be in front of your actor? Or is this a side view.
If it is a former, you can add an arrow component and use it as a spawn point for your projectile. Here’s a great non Epic tutorial that gives an example: