Hi
I’m new to the forum, so first of all - welcome everybody.
I’ve just started using PhysX, and I’ve a problem setting up the character controller.
The snippets from the documentation are simple enough, but when I created the character, it doesn’t respond to my calling the ‘move’ method, nor is affected by the gravity.
I compared my code against the samples, but couldn’t spot anything out of the ordinary.
I checked my scene in PVD as well - the controller appears in it, but it hovers midst air.
Here’s the code I’m using to instantiate it:
PxCapsuleControllerDesc desc;
desc.height = 1.8f;
desc.radius = 0.4f;
desc.maxJumpHeight = 0.5f;
desc.material = material; // the material is correctly initialized - I tested it on the rigid bodies and it worked just fine
desc.slopeLimit = 45.0f;
desc.stepOffset = 0.5f;
desc.upDirection = physx::PxVec3( 0, 0, 1 ); // I'm using the Z axis as the up axis
desc.climbingMode = physx::PxCapsuleClimbingMode::eEASY;
desc.contactOffset = 0.01f;
desc.invisibleWallHeight = 6.0f;
desc.position = characterStartupPos; // the position is selected so that the character starts while hovering above the floor
m_controller = m_characterControllersManager->createController( desc );
The controller manager does exist and was created according to the instructions from the manual.
I’m of course calling the scene’s ‘simulate’ and ‘fetchResults’ methods every frame :)
What am I missing here? Appreciate all the help.
Piotr
EDIT: I just noticed, that by decreasing the slopeLimit to 0, the character starts obeying the move command.
It does not however react to the graviy.