Aim Offsets Bluprint Help

I have an aim offset created which appears fine in the blend space and the variable slider works to make the characater aim up forward and down just like the video shown below
https://drive.google.com/file/d/0B0e...it?usp=sharing

However im not sure how this is driven by the blueprint to get the pitch values from the mouse. can any 1 help me out with this please? Are there any tutorials showing this process of creating aim offset blends with blueprints?

Why hasnt UE4 created a series like the third person tutorial showing weapon aiming, weapon animation, weapon changing, weapon pick ups this would be great resource for us noobs to have the processes behind this shizzle.

Theres loads of random tuts out there but im struggling to find anything really showing this process so i can gain a better understanding and achieve pitch aiming.

To me its strange that such a big thing which is a character holding an object which covers almost all types of games hasn’t been tutorialised! And yes i have been searching now for some time but still no joy… HEAD, BRICK WALL spings to mind… + i bet it would be 1 of the most popular videos on the tube as i find a lot of posts unanswered about aiming or holding weapons… If UE cant do the Vids can 1 of you bright sparks!!!

Any way my very 1st post is done take it easy folks and I don’t expect this to get answered but thought iv been stuck on this long enough its worth a try.

i take it you have seen this page Aim Offset | Unreal Engine Documentation

then also have a look at the shooter game demo which has aim offsets in the character blueprint

i think the main reason epic hasn’t done any tutorials on this is that they want people to do all sort of game with ue4 not just fps

Hi GeoDav,
thx for the reply bud and yes i have read the link below

And I have this part done i can see my character in the blend space aiming up forward and down however i don’t know how to apply this so the character in game looks up n down. So I guess my blueprint or something else is stopping my actual character doing the blend space or my mouse isn’t set up to pass the var pitch to blend space and this is what im after… I just dont know what is the next step is to get working.

“then also have a look at the shooter game demo which has aim offsets in the character blueprint” I have taken a look in there and will have to continue looking at it as iv tried code from there too and no joy.

“i think the main reason epic hasn’t done any tutorials on this is that they want people to do all sort of game with ue4 not just fps” Most character games though will involve holding, switching objects instead of a weapon a tennis racket, golf club, an object to build somat there’s plenty of scope for games using characters and objects and would be invaluable to us noobs to have the correct approach and practices from the pros how to this can be achieved.

But thx again for replying good man…

i just checked the animblueprint in the shooter game and they use a blendspace for the aimoffset now i’m not sure why but that could be due to the fact the demo was made during the beta phase before the aimoffset node was even made, but have a look and see if you have your animbleprint set up that way if not then give me a shout and we can try a solve your issues

Cheers again ill take a look when i get a min… ill try a blend space instead of the aim offset but i think its the blue print not sure i have the correct setup to send the pitch to the offset/blend

Davross: in your Anim Blueprint, manually type in some values for the X and Y pins in your Aim Offset / Blendspace and click the “update preview” button. You should see an aim pose for your character. If you don’t, that means you aren’t properly applying/combining your base pose with your aim offset/blend.

If it DOES update, then you just need to pass pitch and yaw vars to the aim offset inputs. This can be done in your blueprint by taking the Delta (Rotation) between Get Character Rot and Get Actor Rot (i.e. How far the character capsule is rotated from the way the camera is facing), then feeding that to a Break Rot and sending the Yaw and Pitch to the X and Y inputs of the Offset (bearing in mind that these floats may need to he scaled somewhat to deal with the total value range of your blend axes

Cheers RythmScript… Will it matter im trying to do fps with 3rd person bp, ie camera n what not? I wont be using yaw just pitch and the blend space and animationBP do allow me to slide the Pitch Var Slider to change aim. Do you have a screen grap of your blueprint that shows this setup? I probably need something to look at to see where im going wrong but again any help is always appreciated…

If you’re only using pitch, you need to make sure your CharacterMovementComponent is set up so that the camera direction controls the capsule rotation.

I can’t give you a screen grab of my own BP since I’m doing something different (letting the player movement control the capsule and building the aim offsets from that, so the player can run in a different direction than they’re looking/aiming, rather than relying on strafe anims)

But I can tell you what to do. In your character blueprint, insert a “Get Control Rotation” function, then feed it to a Break Rot. On your Event Tick, Set a new Float variable to the Pitch output of that Break Rot (“AimPitch” or whatever), and then call an Interface Message immediately after to pass this variable to the AnimBlueprint.

In the AnimBlueprint EventGraph, in your Tick execution path, add a call to the Interface function in question to get that AimPitch var, and set it to a new variable in use by the AnimBlueprint (i.e. AimOffsetPitch). Also, after this, add a Print and print the value of AimOffsetPitch.

Now, play in editor, and look down and then up. Watch the stream of Printed outputs; this will tell you the range, from Down to Up, that this float will be.

Inside your (1D) Aim Offset or Blendspace, make sure the axis range matches this range of values (i.e. If you see a range of 0 to 180, but your Aim blend range is 0-100, update that and reposition the nodes).

Now, in your AnimBlueprint AnimGraph, where you’re calling the aim offset, add a Get to your AimOffsetPitch var, and connect it to the float input for the Aim Offset.

The net result is this: every tick, the game will determine the camera orientation, extract the pitch value, send it to the anim blueprint, and feed it to the pitch input of your Blend.

Cheers RhythmScript Noobalert: can i ask please how do i go about the "Interface Message/interface function and setting this up?? is it blueprint interface?

That’s okay, interfaces are extremely confusing and counter-intuitive at first and the documentation for them is pretty bad. But once you get the hang of them, they’re indispensable.

So, first create a new Blueprint Interface called “CharacterAnimDriver”. Add a Function to it called “SendPitch” (my own personal habit for interfaces has been to name them based on some imaginary hierarchy; here, the character bp uses an interface to “drive” the animations. Functions that pass data from character to anim are Send, functions which pass data from anim to character are Get, etc. You don’t have to use this convention, but I urge you to settle on SOME naming convention as Interfaces get unwieldy fast and are highly finicky things).

Make sure you add an output to SendPitch (you don’t need an input). Make sure this output is of the Float type (since you’re trying to pass float data), and has a unique name (say, AimPitchOutput).

Compile the Interface.

Now, in your character BP, hit the “Blueprint Props” button up top, then in the details pane, add the interface you just created. Do the same thing in your Anim bp.

Back in the character BP, add the SendPitch function (FROM the “Interface Messages” part of the menu; a duplicate will appear in Functions, but don’t use that. The function node should have a little envelope icon in the corner)

Right click and type self, to get a reference to self, and connect it to the Target of the SendPitch Interface Message. This tells the BP that when it calls the Interface Message, it should call the version in THIS BP (an IM can have multiple versions in each BP; Unreal needs to know which iteration to call).

Double-click the interface message to modify it; this will let you modify the message FOR THIS BP. Inside here, add the “Get” to the Pitch float var you’re Setting just before you get here, and connect it to the output pin.

Compile, save.

Go to your AnimBP. In your execution flow, call the “SendPitch” Interface message. Add a “Try Get Pawn Owner” and connect it to the Target pin. Since the Pawn Owner of your AnimBP is the Character, this tells Unreal to call SendPitch AS IT EXISTS IN YOUR CHARACTER BP.

Since, in your character BP, it was simply feeding the Pitch float to its output, what this does is causes your Anim BP to “hop over” to the Character BP, call the IM function which is getting a variable from the Character BP, and pass it to an output that the AnimBP can see. By setting that output to be a new Var IN the AnimBP, you can subsequently call it in the Anim Graph to feed your blendspace.

So that’s interface messages. Learn them well; any time you need your inputs to do anything but drive the capsule around, they’ll be your friend (e.g. You can use IMs to send events for when the reload button is pressed to trigger a reload anim. Then you can use them to send AnimNotify from the anim back to the character BP so the ammo count can reset once the anim has completed. Etc).

Cheeers RythmScript I shall give this a try a soon as I can… this should resolve the issue ill let you know again thx alot much appreciated

Hi RhythmScript I’ve been a little busy but managed to implement what you said last night and Yes that has resolved my issue thanks again