Currently I have a playerWorld matrix which holds the position of my player, just a simple sphere. When I press a key to move the model, it does some crazy thing and flies off the screen really fast, and not even in the direction I want it to go.
if (kbs.IsKeyDown(Keys.W))
{
playerWorld += Matrix.CreateTranslation(playerWorld.Forward * elapsed);
}
Why is this happening? elapsed is a float variable:
float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;
Here is the draw code, maybe it's being drawn wrong?
public void Render(ThirdPersonCam cam)
{
foreach (ModelMesh mesh in playerModel.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.View = cam.view;
effect.Projection = cam.proj;
effect.World = playerTransforms[mesh.ParentBone.Index] * playerWorld;
}
mesh.Draw();
}
}