Page 1 of 1

Unexpected Capsule shape settings

Posted: Sun Aug 25, 2019 10:43 pm
by SugarGlider
Hi

So, I have terrain included in my physics and also character controllers for my player avatar. Im not sure if its a bug or just me making assumptions but took me awhile to work out why characters did not stand on the terrain exactly. Turns out the capsule height must be set using the following formula.

Code: Select all

CapsuleHeight = AvatarHeight - (CapsuleRadius * 2)
Seems a bit counter intuitive. I guess the height is for the cylinder part and the rounded ends are not included :oops:

Re: Unexpected Capsule shape settings

Posted: Mon Aug 26, 2019 6:47 pm
by Norbo
Yup, the capsule 'length' refers to the length of the internal line segment, and the 'radius' is the spherical expansion around that line segment.

(The reasoning here was that any nonnegative value for length works under this interpretation, whereas if it referred to the line+radius, there would be invalid positive values.)