Seting size of player

Hello,

I have a game with first person view and character doesn’t fit on door.

How to resize him?



chris_black

Depends on what collision shape you gave it :roll: Since you probably just copypasted, I guess its a cylinder and you can simply raise its height.

player = new CharacterControl(capsuleShape, 0.05f);

bulletAppState.getPhysicsSpace().add(player);



Code of making player.

But player doesn’t fit on door!

Change the size of the cylinder collision shape!!

I guess for more info you must tell us the code for creating the capsuleShape.

you likely created your collision shape like this:

[java]

CapsuleCollisionShape capsuleShape = new CapsuleCollisionShape(1.5f, 6f, 1);

[/java]

the 1.5f is the setting for the capsule’s radius as a float (in world units)

the 6f is the setting for the capsule’s height as a float (in world units)

the 1 is the setting for which axis is used as “up” as an int (1 is default)



if your doorway (in this case) is less than 1.5 world units wide or less than 6 world units tall,

you will have to change those float values to something smaller. (or widen the door)



also worth note, in the constructor:

[java]

player = new CharacterControl(capsuleShape, 0.05f);

[/java]

the float 0.05f is the setting for the player’s stepheight,

make sure the doorway doesnt have a step or lip that is higher

than this number above the ground outside,

afaik, 1 world unit = about 1 meter, 0.05 of 1 world unit is pretty small

so setting stepHeight to 0.25f or 0.5f would make it a bit more useable