Making a Third Person Action RPG and I am wanting to make my pawn face the location the camera is facing when I shoot a projectile, I’ll assume there is a node sequence used for this type of action.
Here’s what’s happening atm - https://i.gyazo.com/97035f3f65c4f0120a3baab13ef36741.gif
Prolly won’t need it, but here’s the graph I have attached to On Left Mouse Clicked Event - https://i.gyazo.com/2576c0c58f118a22579ccc2c4372129a.png
Cheers,
Hello DP Studio,
let us get started with some fun vector math.
In your character, create a new variable and call it ‘CameraHeight’; this will be the height of the camera above your character’s location. Create a second variable and call it “XY Plane Distance”; this will be the distance of the camera in the projected XY plane.
In your event tick, get the forward vector of your character (https://docs.unrealengine.com/latest/INT/BlueprintAPI/Utilities/Transformation/GetActorForwardVector/index.html); let’s call it NextCameraLoc for reference. Normalise NextCameraLoc and scale it by your variable ‘XY Plane Distance’ and set its Z coordinate to ‘CameraHeight’. Next set the relative Location of your camera component to NextCameraLoc.
That is your location, now let us sort out your rotation: Luckly, somebody has already answered that here: https://answers.unrealengine.com/questions/40413/3d-object-always-facing-playercamera.html. In the picture you see, only change the GetActorLocation at the bottom, which is the second argument in the substraction, and replace it with NextCameraLoc.
You should be all set up now.
Cheers,
Univise
Hey, should of made it clear that this is my second week working with Blueprints (All other work was mainly aimed at Material Graphs and Level Design) a lot of what you said made sense, but I lack the knowledge to make sense of some (MOST!) of it haha…
But here is what I’ve gotten so far:
BlueprintUE
PasteBin
I have a few #questions that I’ve added into the comment bubbles inside of the BP
p.s Vector Math is not so fun
just a guess at what you’re trying to do… but i think it depends on how you’re “aiming” and how your camera moves. Are you using a crosshair? or just basic directional shooting.
Anyway you could have a look at setting the “use controller rotation yaw” bool. And play with setting it on or off before and after shots… etc…
Oh gosh, you are awesome!
Have it set on a retriggerable delay so it has some time to shoot the arrow