Limiting Aim offset

How many bones are you modifying in the animBP?

Hi, I’ve made my character look up and down, using the Transform (modify) bone node in the Anim graph, but is there anyway I can make him stopping rotating at a certain point? His whole body looks down 90 degrees, and his back bends 90 degrees, is there a way to make him stop at a certain point to make it look realistic as a real human would? Thanks

Yes, in the animBP create a new variable and call it I dunno “AimOffsetRotation” or something along those lines then get the owning pawn’s control rotation (Try Get Pawn Owner drag pin and Get Control Rotation) from the rotation return right click and Split Struct Pin grab the Pitch value and multiply it by -1…on second thought this will be better represented in a screenshot:

You set the X (Roll) value in the variable because the character is looking up & down and X is the forward vector of the bone for pitch. The Clamp is where you set the limit in degrees each bone should rotate in this example I am setting the modify bone transform rotation on 3 bones, spine_01, spine_02 and spine_03. so each is limited to 15 degrees of movement.

Dude, thank you seriously, also I have 1 spine bone. My model is kind of like a minecraft steve mesh but I don’t want him bending all the way forward, and backwards 90 degrees, I have not tried this yet and if I have any problems ill reply again to you, in the meantime is there way I can commend you or something?

Okay, so I added all that you showed me, but now its choppy, he’ll bend up or down super quick? How do I blend this to make him look up or down smoothly?

My character’s default camera is first person, but I have a third person optional. My aim rotation is being set from a sequence that is connected to a set variable named ‘Speed’. So there is a function I need for blending?

Nope, not really, not until the question is resolved/answer accepted…but don’t do that until we get it working for you

Ah HA! I knew I forgot something…hang on I need to make another screenshot…it requires a function in the animBP to do it smoothly…give me like 5 minutes to throw it together real quick.

Actually on second thought…is your character setup as a third person view?

Oh and at what point are you setting the AimOffset variable? it should be updating directly off of the EventBluePrintUpdateAnimation node…you shouldn’t need the function that I was thinking of…we need to look at how it is updating first

Oh ok, then you should setup a branch and a bool to only update the rot variable when in third person view only

This way is actually better a float select node:

- YouTube here is an example of it in action

How were you making the character look up and down before?

Before, I had the basic set up. It was just ‘cast to character’ - ‘get control rotation’ - then break rot. connected to a make rot. Sorry I’m a little confuse, I should only have this on a third person view? my game is going to have multiplayer soon, so would that work?

Oh, do you mind If you could send a picture to what you mean by a branch and a bool? It’s kinda hard to send HD pics for me, for some reason.

Have you disconnected the way you had the character looking up and down previously or is that also still executing?

I changed it to a float select instead of a branch and a bool now it is just the bool that will determine if it should update the rot or not…the reason for the switch is you are most likely handling movement and control rotation differently in first person view than how you are in third person view I would assume anyway otherwise the body will arc faster than the character is actually looking up

I made all the adjustments shown in your picture onto my character, I want my game to be mulyiplayer. I would show you my conections, but how do I send HD photos like you are? Also what is the actual float name you changed the branch to?

Take a screenshot, Ctrl+Alt+PrtScn will take a screenshot of the open window you can then paste that in paint or gimp and then save it and then use this button to attach it here:

83017-imageupload.png