- Home /
Changing character's capsule collider's height based on its model's height
Hey guys. I've decided that I am going to be taking on the task of creating a custom character controller for my game, and I made a list of things that I want it to be able to do. One of those things on that list was that it would resize the capsule collider's height based on what my character model looks like he is doing (from his animations and such). For instance, if my player model does a duck animation and ducks down, I don't want to have to manually program the capsule collider to adjust its height to the height of my character model when hes ducked. I want it to be able to do that on its own. My game is all about movement and the character doing parkour moves and stuff like that, so it might get very tedious and inefficient to have to change the height of the capsule collider every time the character's model is at a different height. I would love advice on how to automate this. I was thinking about possibly using the character's head bone from his rig as a reference point to adjust the height of the capsule collider but idk if i'm on to something or not (maybe let me know what you guys think of this approach). Also, I am shooting for a 60 fps game so I am trying to keep my code as efficient as possible.
Also how expensive is it to update a capsule collider's height (since i'm shooting for a fast perfor$$anonymous$$g game)?