I wish to have a sort of "slow motion" or "slow down" effect on a players character when they walk in a mud area, usually the character velocity is
3f constant in any one direction. The problem is I tried to declare a rectangle to cover the object mud area but I am only able to get a solid rectangle area and therefore the character cannot walk through or over this area, the desired action would be having the character movement slow down while walking in the mud area. The code below is what I have tried to make this sort of region, but this code only makes a solid object which the character cannot pass through.
final Rectangle rect = new Rectangle( object.getX(), object.getY(), object.getWidth(), object.getHeight(), vbom ); final FixtureDef fixDef = PhysicsFactory.createFixtureDef( 0.0f, 0.0f, 1.0f ); Body body = PhysicsFactory.createBoxBody( physicsWorld, rect, BodyDef.BodyType.KinematicBody, fixDef ); body.setUserData( typeOfObject ); physicsWorld.registerPhysicsConnector( new PhysicsConnector( rect, body ) );