Forums Gallery LOGIN |REGISTER

Changing players bounding box?

Please use this forum for questions on C++, Lua, XML, and any other languages used in CryENGINE development.


User avatar bac9-flcl
Skilled Developer
Skilled Developer
Posts: 714
Member since: 30.04.2010, 14:42
Location: Russia
Likes: 25

Changing players bounding box?

Postby bac9-flcl » 12.02.2012, 14:42

Greetings. Very simple question here: is it possible to edit player bounding box size? Working with real-scale doorways, stairs, and so on, I often have problems navigating there with default, relatively big bounding box. The character is a bit fat, you know. :)

Thanks in advance! :)
User avatar Riaction
Just getting started
Just getting started
Posts: 73
Member since: 26.10.2009, 05:06
Location: Australia
Likes: 0

Re: Changing players bounding box?

Postby Riaction » 13.02.2012, 05:56

Not sure if this is the best way to do it, but you can modify the player.lua file (found in Scripts/entities/actor/ folder).
If you look at the Stance section of the file (near the top ish) it will look something like this:
Code: Select all
stanceId = STANCE_STAND,
maxSpeed = 4.0,
heightCollider = 1.25,
heightPivot = 0.0,
size = {x=0.41,y=0.41,z=0.3},
viewOffset = {x=0,y=0.065,z=1.65},
weaponOffset = {x=0.2,y=0.0,z=1.35},
viewDownYMod = 0.05,
modelOffset = {x=0,y=0,z=0.0},
name = "stand",
useCapsule = 1,

If you change the size's Z parameter from 0.3 down to say 0.2 then that will make the character short enough to fit through a standard height door. You can try fiddling with the other values as well but it might take some trial and error until you get something that works the way you like it. Also note that you may want to change the values for the other stances as well (crouch, swim etc) depending on your needs.