Page 1 of 1

crouching

Posted: Wed Jun 02, 2004 11:46 pm
by gothikal1
Is it possible to crouch while using the fps cam, and if so, how would one go about it?

Posted: Thu Jun 03, 2004 6:20 pm
by saigumi

Code: Select all

  irr::vector3df vPosition = camera->getPosition();
  vPosition.Y -= 50; // Or whatever the difference between standing and crouching
camera->setPosition(vPosition);
Then, when the person lets go of the key, raise the height again.

Posted: Thu Jun 03, 2004 11:40 pm
by Guest
what about the level. I tried that and it doesn't crouch because the level is in the way

Posted: Fri Jun 04, 2004 3:53 am
by dingo
You'll need to also change the size of the player for collision purposes.

Check out the collision tut and see the point where 3 numbers defin the collision ellipsoid and just change those when crouched.

Without doing this your player is still say 6 feet tall but you are just positioning his/her eyes halfway down rather then "physically" crouching.