Blendspace and vim help for aim offsets

I am creating an aim offset so for aiming. I have created a blendspace and used the aimuo down and left right animations from shootergame on my skeleton which is the same and the animation works. When I create my blendspace, the character is not performing an aim and instead does the animation where the arms are spread out and is looks like a T. It blends and looks properly but the arms and back are not positioned as if it were aiming. Is there maybe a tutorial for aim offsets? Another thing is in the vim blueprint i know how to use apply additive and the use the blendspace as additive but the fo rthe aim yaw and pitch i need the rotation variables of the player. If you get the idea of what im doing, can anyone help showing a basic instruction for aimoffsets.

Dear Eshwar,

I have aim offsets working in my game,

in my case I’m actually using a completely custom setup with my own anims and extended anim bp to obtain pitch and yaw using my own method in different way than shootergame example,

so I can walk you through this!

for starters

please send a pic of your aim offset blendspace hooked directly into your Result in your anim bp (over-riding all other animation)

from there we can debug the values that are being passed to your blend space

I’ve included a pic of my setup for reference



I see i didnt plug my blendspace directly into the result. I cant also because i dont know how to make Im Yaw and AimPitch variables for the Blendspace node. How did you do that and make it coordinate with the Rotation yaw and pitch of the controller?

If you are basing your code on the shootergame example, if you right click and go under variables there should be AimYaw and AimPitch, as set in the Event Graph of the anim blueprint :slight_smile:

You connect those to the blend space!

to coordinate with yaw and pitch of controller

go to your character blueprint

and set

bUseControllerRotationPitch = true;
bUseControllerRotationYaw = true;

I am not working with shootergame sample i am using the first person template and am starting from fresh.

well if you dont want to dive into the c++ and create your own anim instance, my code wont work as well for you, if you do want to do that let me know.

I recommend you look at the shootergame and copy how they obtain AimPitch and AimYaw

in the event graph for the shooter character anim blueprint

They call a function

whose c++ code is available to you from the shootergame example and you can just copy and paste.

Thank you. I know hot they make aim yaw and pitch. Really they made a Ufunction which is blueprint callable called GetAimOffsets. They call that in the vim and break the return value(rotator) to pitch yaw and roll and use that pitch and yaw to set aim pitch and aim yaw. Just i dont know how to call the function in the blueprint. I really dont know much about animation just i want to be able to do the basics. Also reason i am not using shooter game is because they use two meshes and one is only arms and i am making mine true fps.

Hi Eshwar,

It looks like GetBaseAimRotation (and the functions that it in turn calls) are not exposed to blueprints right now. I’ll start a thread about getting those exposed, but for now you can probably use the controller or camera viewpoint.

One way to get those would be to:

  • TryGetPawnOwner
  • GetController
  • Cast the result of that to PlayerController
  • Get PlayerCamera
  • Get Rotation of the player camera instance

This is kind of a roundabout way to get to it; if you are viewing thru a camera component, you could just get it’s world rotation directly as well.

Michael Noland

For now as said in the discussion if i could know how to call a function that is in my code that would help and resolve my problem. I have Getaimoffsets which gets the rotation of my character. I need to call that and that function is in my character class.

Hi Eshwar,

Do TryGetPawnOwner, followed by a Cast to the particular type of your Character class (if it’s a native class). If the function you want to call in your character class was introduced in a blueprint, then you’ll need to create an interface and send an interface message to call it, just like any other blueprint comms.

Michael Noland

Dear Eshwar,

In the .h file that has the function that you want to call from blueprints:

put this above it, make sure the function is in public: not protected or private

/** Editor Visible Comment */
UFUNCTION(BlueprintCallable, Category=Functions)
//your function definition as usual

Let us know how that goes!