Hello,
I have an issue trying to sit the character properly on a chair.
I'm working on the 2.3.1 version of Ultimate Character Controller on Unity 2020.3.2f1.
I created an interactable ability to sit on a chair object, activable pressing the F key when the character collides with a box around the chair. The character have 3 animations here: StandToSit, IDLE_Sit and SitToStand (the user make him stand up by pressing F a second time). Then my issue is with the character's capsule collider, it doesn't let the character put his buttocks on the chair: either he sits in front of the chair, with his feet on the floor and his buttocks flying, or the character is sits with his feet on the chair and his buttocks still flying above the chair. See those pictures because it's hard to explain:
That I understand, this is because the character's capsule's height doesn't change during the StandToSit animation and the the bottom of the capsule is still touching the floor. The chair's collider and the capsule don't let the character to sit properly, as we can see on these picture:
I tried to reduce the capsule height by calling an event during the StandToSit animation, but it doesn't work because apparently the capsule's height is constantly given by the CapsuleColliderPositioner.cs script and it keeps it high. For now I don't know how I could change or use this script to solve my collision problem. And of course I try to change back the capsule's size with another event during the SitToStand animation, but as far as the capsule's size doesn't change with my events, this is neither a success.
So please, if you see a clue to help me change the capsule height or solve this sitting issue in another way, I would be very grateful.
I'm a beginner on Ultimate Character Controller, so I would take any advice, thank you in advance for your kindness.
I have an issue trying to sit the character properly on a chair.
I'm working on the 2.3.1 version of Ultimate Character Controller on Unity 2020.3.2f1.
I created an interactable ability to sit on a chair object, activable pressing the F key when the character collides with a box around the chair. The character have 3 animations here: StandToSit, IDLE_Sit and SitToStand (the user make him stand up by pressing F a second time). Then my issue is with the character's capsule collider, it doesn't let the character put his buttocks on the chair: either he sits in front of the chair, with his feet on the floor and his buttocks flying, or the character is sits with his feet on the chair and his buttocks still flying above the chair. See those pictures because it's hard to explain:
That I understand, this is because the character's capsule's height doesn't change during the StandToSit animation and the the bottom of the capsule is still touching the floor. The chair's collider and the capsule don't let the character to sit properly, as we can see on these picture:
I tried to reduce the capsule height by calling an event during the StandToSit animation, but it doesn't work because apparently the capsule's height is constantly given by the CapsuleColliderPositioner.cs script and it keeps it high. For now I don't know how I could change or use this script to solve my collision problem. And of course I try to change back the capsule's size with another event during the SitToStand animation, but as far as the capsule's size doesn't change with my events, this is neither a success.
So please, if you see a clue to help me change the capsule height or solve this sitting issue in another way, I would be very grateful.
I'm a beginner on Ultimate Character Controller, so I would take any advice, thank you in advance for your kindness.
Last edited: