capsule collider how direction change to z axis c# ?


Is there a way change direction change to z axis in c#

I have not found a clear solution

thank you

On the capsule collider script, there is a direction option. By default its X-axis, just click it and a drop down to change it to Y-axis should appear.


If you want to do it through code, get the reference to the collider and set the direction (collider.direction). It takes an int, so 0 = x, 1 = y, 2 = z.