Aiming with Pitch and Yaw third person issues?

Hello

I’m trying to setup the blueprint for my third person pawn, but I have some issues using pitch and yaw when aiming…

When I’m idle and looking backwards and press the right mouse button to enter Aim mode, the gun is not facing the crosshair…

Another problem is that the pitch aiming is slow and feels unresponsive in aim mode…

I’ve made a video showing some of the problems I have with my blueprint:

http://youtu.be/MJ8VYcC53Dk
I’m using the Mesh from the Matinee sample for testing purposes…

I’ve experimented with a few things, trying to get aim working. Like attaching the camera to the head and the rifle to make a FPS aim, but it gave me some other issues…

Here is a video showing my blueprint:

https://www.youtube.com/watch?v=Mtw_rE2KTP8

Also can someone tell me how can make my pawn rotate with animation, when the idle camera is rotated more then 90 degrees to the sides(When the yaw animation stops)… So he always has the camera to his back and still can use the yaw animations when he’s idle and looking around…

3rd person with camera boom is kinda tricky if you set up your hierarchy wrong.
Try see the UFO asset’s camera rig in example content(it drives camera with a bit of lag before the boom component have a lag parameter),
so it actually use camera to drive rotation of the UFO mesh.

I hope I have easy way to tell you how this could be done, but just keep this in mind:
your control input should always directly does something to “one” actor or that one actor’s “one” component(ie. camera).
All the rest are the cascade events driven from the change of that actor/component.

When you want something to snap quick, use function and don’t do the interploation.
Otherwise use event and interpolation to drive say rotation to your goal(viewing direction).

And last, replicate things you truly needed, not every single parameter.

Thanks for the reply…

I’ve looked at the UFO input sample and it looks complicated, I’m not sure if I am able to make it yet. I’ve just started working with blueprints few weeks ago.

So a sample on how to do this with third person pawn would be cool…

I know my blueprint is a little messy, and I got a little carried away with replicating when I was struggling to get networking to work. But I will clean it up later…

And I forgot to show my components screen in the video:

30352fac38bea9e675caf3226d85f0834cc23afe.jpeg

in your setup, your camera boom is attached to the root, and mesh attached to root as well.
This means the rotation of boom is independent of character rotation(unless some control triggered to change view angle like in your video.)

There are no exact answer to your question, you might need to experiment more, here a few suggestion:

  1. start with actual third person template and work your way to get a first person view with proper control
  2. stick with your current solution but you need to manually sync up camera and mesh rotation like in the UFO example I mentioned
  3. brave enough? do it with a C++ project and you can derive fro the third person code template and adjust default hierarchy as you see fit.
    (and maybe merge some part of first person code template. )

These options are equally valid and totally depends on how much you already invested in current pawn blueprint.
personally I would suggest 1 for any new beginner.

Okay I’ve started on a new third person template…

I see in the shooter sample that the player pawn contains a first person and third person mesh. So I tried to see if I could switch between the two meshs using blueprint.

https://www.youtube.com/watch?v=cEz0_MV-FzE

But as you can see I have some collision problems I don’t know how to fix…

Anyone knows a better method to do this?

you are almost there.
the reason being when you are using the camera boom(spring arm), there is a small collision sphere(that are hidden) to represent where the camera is.
So what you need to do is go to your spring arm component(both in default/component), and look for collision related attributes, write that down.
Then when you switch between FP/TP view, enable/disable collision sphere of that would fix your problem.

I have a possible solution:

At 47 seconds into your Pawn Test Aim1 Blueprint youtube video, there’s a (I can’t quite make it out but it looks like) ‘Interp to’ node, set the “Interp Speed” on that node to 0.

You didn’t open up your “SetPitch” function inside your character blueprint, but you might have the same thing in there as well. In which case, try setting it to 0 also.

The ‘interp speed’ tries to smooth your animation out. So with it being at 0 the animation will be really accurate but a bit choppy in it’s movement.

I have a feeling you will eventually have to redesign your weapon fire system. You’ve got the weapon fire shooting at where the character animation is aiming. I doubt you will ever be able to get that type of system completely smooth and accurate. Instead you’ll probably have to incorporate a little movie magic. Keep the muzzle flash at the tip of the weapon of course, but make the actual spawning of projectiles in accordance with the camera angle and try your best to make it look like its really coming out of the barrel.

Not sure what to look for, but I found Do collision test which seems to work:

https://www.youtube.com/watch?v=Gt77f5FOCwU

But I have some clipping issues I need to fix…

also add pitch and perhaps yaw if I can get to work…

And then still figure out how I add a rotating animation to my pawn

My animation blueprint from my first attempt is very messy, so I think I will start from scratch. Now when I have a little better understanding of blueprints…

And yes the gun blueprint is not working perfect, I will need to find a better solution…

the clip problem around 0:24 is standard issues, as in some game they have bigger capsule(or additional capsule) to include hands, in some game they make the pawn do a holster animation(so you can’t shoot), and in the rest they don’t care and are exactly like that.(especially noticeable when you hold a rifle, most game will just let the gun go through walls.)

pitch/yaw for TP view is workable with camera view location/animation blend, try search for aim offset threads, there is plenty.

for rotation of say head->torso->whole body, that’s a different story, as they are very specific and won’t look good if you don’t have those base animation available to you.

New update

Trying to add pitch and yaw animations, but I knew adding yaw would give me problems again:

https://www.youtube.com/watch?v=pdhhf2kxOHM

I need to find out how to make my pawn turn when I look around…

I’m in the same boat as you, even have a thread right now similar to yours, I’m at work so I can’t help too much but check this out: How to constrain camera/controller rotation? - Blueprint - Unreal Engine Forums

Also check out the code in this thread: Foundational 3rd Person Camera to Shoulder Camera Toggle - Blueprint - Unreal Engine Forums

When the camera is facing the players face (looking behind the player character) and you press right click on your mouse, it’ll rotate your character to face the direction of the camera/crosshair. I’m sure you could mix that code up a bit to rotate your character with camera movement.