[SOLVED] Raycasting on a capsule collider

The render for the collision is wrong which is why it looks right but isn’t in game.

The height is wrong in the collision component because the model for the capsule is 2 units high, not 1.

If you put two of the cubes on top of each other, it be the same height as the capsule model. As the cubes are 1 unit in height each, this means that capsule height is 2 units high.

Do you agree with me that the capsule model is 2 units in height first of all?

Yes, I agree.

Cool, then the height of the collision component should match that.

The scale of entity will multiple the size of the model. So if the scale of the entity is changed to 2,2,2 , the height, width and depth of the model is multiplied by 2 meaning that the height should be changed to 4.

So the height of a capsule collider is also a half extent? If that’s the case then I get you. Because of the bug it looks like the capsule collider is the same height but actually it’s the half of it?

No, it’s the full height. (From the bottom of the capsule to the top is 2 units, therefore the height set is in the collider is 2 units)

The collision render in the viewport is being rendered at double the height set in the collision.

If the scale of my capsule entity is 1 on the y-axis, what has to be normally the height of the capsule collision height to get the same height as the model?

2 which is the the height of the model which is the value I’ve set in my project and can be seen to be correct in the launch tab.

Height of the model (2) * Scale of the entity (1) = 2

Okay. So the problem is still that it looks like the collision component has the right height, but actually it is the half of it?

The collision render in the Editor looks like it is double the height of the value set in the inspector.

Which is why it looks correct set at 1 and is 4 units in height when the collision component height is set at 2.

Then we are finally on the same page. Thank you for the effort! I hope there is a fix soon.

Is this bug fixed?

Yes, it was. You can check the issue in the repository. The capsule collision shape has a correct size in the Editor now.