I was using standart character controller in demo in 1.2 vers;
In the 1.3 CharacterController is't updated at all; I mean some code, what i add (camera rotation of my camera and your grab control) work fine
but CharacterControl.body not moving. CharacterControl added to Space and Space is update normally. But CharacterControl.Body stoped in the ait (even not fall) .
What has changed ?
question about Character controller
Re: question about Character controller
If it's not falling while in the air and gravity is set to some nonzero value, that strongly implies the character is not actually in the space. While a variety of things changed, I don't remember anything related to this which would properly explain what you see.
Could you reproduce the behavior in isolation for me to look at?
Could you reproduce the behavior in isolation for me to look at?
Re: question about Character controller
Hi! Thx for reply. I added the old version of CharacterController but nothing change;
CharacterCOntrollerInput (short version) :
CharacterController class :
Aaand in the game class :
on video position of the CaracterController.Body.
It's Fun but my bot (but not testing he's camera position and etc) that using charactercontroller for moving still work and fall normal on the ground;
And fun that *.exe file of the game is not running on win8 (old vers normally run i don't kwon how is linked)
As you can see on video = position of character body has't change; I pressed all move buttons and jump btn;
CharacterCOntrollerInput (short version) :
Code: Select all
public CharacterControllerInput(Space owningSpace, Camera cameraToUse)
{
CharacterController = new CharacterController();
Space = owningSpace;
Space.Add(CharacterController);
}
// ~~~~~~~~~~~~~~~~~~~
public void Update(float dt, MouseState mouseState, KeyboardState keyboardInput, KeyboardState previousKeyboardInput)
{
if (IsActive)
{
Camera.Position = CharacterController.Body.Position + (CharacterController.StanceManager.CurrentStance == Stance.Standing ?
StandingCameraOffset : CrouchingCameraOffset) * CharacterController.Body.OrientationMatrix.Up;
Vector2 totalMovement = Vector2.Zero;
Microsoft.Xna.Framework.Vector3 movementDir;
if (keyboardInput.IsKeyDown(Keys.E))
{
movementDir = Camera.Transform.Forward;
totalMovement += Vector2.Normalize(new Vector2(movementDir.X, movementDir.Z));
}
if (totalMovement == Vector2.Zero)
CharacterController.HorizontalMotionConstraint.MovementDirection = Vector2.Zero;
else
CharacterController.HorizontalMotionConstraint.MovementDirection = Vector2.Normalize(totalMovement);
CharacterController.StanceManager.DesiredStance = keyboardInput.IsKeyDown(Keys.Z) ? Stance.Crouching : Stance.Standing;
Camera.Transform = Microsoft.Xna.Framework.Matrix.CreateRotationX(MathHelper.ToRadians(_pitch))
* Microsoft.Xna.Framework.Matrix.CreateRotationY(MathHelper.ToRadians(_yaw))
* Microsoft.Xna.Framework.Matrix.CreateTranslation(MathConverter.Convert(Camera.Position));
}
Code: Select all
public CharacterController()
: this(new Vector3(), 0.5f, 0.5f * .7f, .04f, 10f) { }
Code: Select all
void LoadContent()
{
World.space.ForceUpdater.Gravity = new BEPUutilities.Vector3(0, -2.81f, 0);
World.charIn = new CharacterControllerInput(World.space, _camera);
World.charIn.Activate();
}
~~~~~~
void Update(GameTime gameTime)
{
World.space.Update((float)gameTime.ElapsedGameTime.TotalSeconds);
World.charIn.Update((float)gameTime.ElapsedGameTime.TotalSeconds, mouse, ss, prevKey);
}
It's Fun but my bot (but not testing he's camera position and etc) that using charactercontroller for moving still work and fall normal on the ground;
And fun that *.exe file of the game is not running on win8 (old vers normally run i don't kwon how is linked)
As you can see on video = position of character body has't change; I pressed all move buttons and jump btn;
Re: question about Character controller
At a glance I still don't see anything wrong, but the leading theory based on the described behavior is still that the character is still somehow not actually in the Space.
I would recommend walking through/putting breakpoints in the code with a debugger to verify that the character and its body are in the Space, that the Space is being updated, and that the input is being handled as expected.
If you verify that all of that is working correctly, look for anything that might be controlling the Body entity outside of the character. For example, if its position is being continually reset, it wouldn't be able to move (though its velocity would continue to change unless it was also reset).
I would recommend walking through/putting breakpoints in the code with a debugger to verify that the character and its body are in the Space, that the Space is being updated, and that the input is being handled as expected.
If you verify that all of that is working correctly, look for anything that might be controlling the Body entity outside of the character. For example, if its position is being continually reset, it wouldn't be able to move (though its velocity would continue to change unless it was also reset).
Re: question about Character controller
Sorry for wasted time! He's really just was not in the space.
Thx for helping !!!
Thx for helping !!!
