V.0.1.0 Devlog - LH


"More Collision Nightmares"

Author: Liam Hans

Posted on: 07/06/24

THE PROBLEM

When setting up our main playable character - whom we have titled "Monk Dude", as he is a monk and a dude - I found a number of animations from Mixamo that came from a Sword and Shield pack. Being that our main character has a sword and we were planning on giving him a shield, I thought "Perfect, this will work just great"; and for the most part it has (we didn't end up giving our player a shield, but the animations still look pretty normal). However, I had one rather major problem. Our standing jump and running jump animations moved our characters mesh (the actual visual representation of our character) higher than it moved his capsule component (the thing that we actually move when we give input) and it kicks his legs up, which only adds to the issue. This posed a major problem as it appeared that we could jump onto things from our mesh's perspective that we actually couldn't jump on to from our capsule component's perspective. If you're confused on the vernacular there is a video below that visually represents our issue.

THE SOLUTION

I wish I could tell you that I crafted some beautiful and clever solution to this issue, and believe me I tried, but unfortunately I could not find a way around this. Within Unreal, there is essentially no way to use your character's mesh for collisions rather than using the capsule component; or at least, no way I could find short of creating your own character class - something we don't have the time to do as that would take days. In one of my attempted solutions, I tried to manually lerp the capsule component to a smaller size throughout the jumping animation, but that didn't work as it only shrinks from the top and bottom simultaneously, so it resulted in a smaller capsule that was even more offset from our mesh than our original capsule. I then thought "hey, I'll just manually lerp my characters mesh down as I shrink my capsule, so I can keep the mesh in the middle of the capsule". That might work, right? Wrong. It did not work. Because the jump is rather quick, the lerp time was also quick, so it resulted in our character's mesh snapping down and then snapping back up very quickly. It sort of gave the result that I wanted as far as collision, but it was far too glitchy looking, so I ended up having to pitch the whole thing. I ended up settling with my least favourite of all my options: switching out the jumping animations. I found a couple of animations that don't bring the mesh's legs up quite as much, so the feet stay more-or-less where the bottom of the capsule is, simulating more realistic collision. Am I thrilled about this solution? Not exactly, as I rather liked our old animations, but it is all I could come up with, and I was already spending more time on this problem than I would have liked. In the end, it does feel pretty good as far as collision accuracy, so there is a silver lining. Below I have attached a video that exhibits the updated animations for jumping. 

Get Plight of the Gods

Leave a comment

Log in with itch.io to leave a comment.