FPS Arms tilting upwards when crouching

Steinvorth

Member
I recently was trying to fix a problem with the FPS mesh tool integration. The issue was that whenever the character was crouching, the arms would disappear. I was told in another forum section to remove the crouch animator, which I did by deleting the entire crouching "section" from the animator. This fixed the arms from disappearing, but now I have another issue that I do not know how to fix.

My new issue is that now the arms are tilting upwards whenever the character goes to crouch. Is there a solution for this, or another way that this can be done so I can fix this problem?

Here is the link to the other answer: https://www.opsive.com/forum/index....-not-working-correctly-maybe.6692/#post-33227
 

Attachments

  • Screenshot 2021-10-13 142907.png
    Screenshot 2021-10-13 142907.png
    93.2 KB · Views: 9
  • Screenshot 2021-10-13 143003.png
    Screenshot 2021-10-13 143003.png
    435.4 KB · Views: 11
  • Screenshot 2021-10-13 143019.png
    Screenshot 2021-10-13 143019.png
    456 KB · Views: 11
You may need to add a state to the FirstPersonPerspectiveItem component that adjusts the Position Offset.

However I'd be interested to know why you needed to remove the Crouch substate on the animator. Your original issue doesn't sound like an animator issue, but could be a SkinnedMeshRenderer bounding area issue instead.
 
You may need to add a state to the FirstPersonPerspectiveItem component that adjusts the Position Offset.

However I'd be interested to know why you needed to remove the Crouch substate on the animator. Your original issue doesn't sound like an animator issue, but could be a SkinnedMeshRenderer bounding area issue instead.
I was told by Justin that I had to remove the crouch animations from the FPS arms in order for them to not "crouch" as well as the body and go out of frame, since they are using the same animation controller. At first, I also tried to correct it with the position offset, but removing the animation crouching "section" from the animator controller seems to work better, since the arms stay in frame, but now the arms are tilted upwards when crouching.
 
Ah so that's the animator you're using on the first person arms? The demo has 2 separate animators, one for the base character ("Demo") and one for the first person arms ("FirstPersonArmsDemo"). They're specifically built to be used for the base character + first person arms accordingly, so using the same one for both will inevitably result in animation mismatches like the one you're seeing. Is there a reason why you're useing the base animator on the first person arms? If it's to solve your original issue of the arms disappearing, then that shouldn't be the solution because you'll just end up with unexpected animation results, like this.
 
I am using the base animations, because the FirstPersonArmsDemo do not work with the FPSMeshTool prefab that it creates. I suppose that it is because of it being animations for a generic mesh, and the tool makes a humanoid mesh, so if I use the arms demo they just stay in a T pose. I also found this on a forum post, so I figured that would be the correct way to use it.

1634745520368.png
 
Yeah, sorry if one of us wasn't clear - the humanoid animator in the demo is designed to be used with the base humanoid full body rig and as such won't always look perfect if used on the first person arms. This is explained in more detail here: https://opsive.com/support/document...troller/animation/animator/first-person-arms/ Unfortunately this is just how the demo animator and animations are designed - you'll need to use a custom animation for crouch (try Mixamo) otherwise.

You can for this specific case just modify the Position/Rotation Offset values in the item's FirstPersonPerspectiveItem (via a state preset using the HeightChange ability's state name), which will probably be enough to get it looking fine. But you should still be aware of the animator stuff I described above in case you run into something like this again.
 
OK thank you so much! I have a question, with those position/rotation values, is there a way for it only to apply when the character is crouching, or does it have to be general position/rotation change?
 
Yep, that's exactly the kind of thing the state system is for: https://opsive.com/support/documentation/ultimate-character-controller/state-system/

I recommend you read the docs and get familiar with the state system because it's an important part of UCC, but a basic summary for your case would be:

- Define a state name for your HeightChange ability (by default in the demo scene it's "Crouch")
- Add a new state preset to your item's FirstPersonPerspectiveItem component
- In this preset, define the position offset values you want
- Set the name next to this preset to "Crouch" (or whatever state name you defined for your HeightChange ability)
 
Top