Page 1 of 1

Player moves real slow on StaticMesh

Posted: Tue Apr 26, 2011 3:36 pm
by Dart
I created a static mesh:

Code: Select all

Vector3[] staticTriangleVertices;
int[] staticTriangleIndices;

TriangleMesh.GetVerticesAndIndicesFromModel(Models.LEVEL01, out staticTriangleVertices, out staticTriangleIndices);
            
StaticMesh staticMesh = new StaticMesh(
    staticTriangleVertices,
    staticTriangleIndices,
    new AffineTransform(
        Matrix3X3.Identity,
        Vector3.Zero));

staticMesh.Sidedness = TriangleSidedness.Counterclockwise;

space.Add(staticMesh);
BepuDebug.Add(staticMesh);
The player moves along it and collides at all the right walls. But he moves very slowly and can't jump. If I make the character spawn on a Box entity, he moves at normal speed and can jump, but if I jump off the box down to the StaticMesh I'm back to moving slowly.

Changing the acceleration has no effect on movement. (Unless I'm standing on a Box entity.)

Any ideas? (I'm using the CharacterController for my player.)

Edit: I just tested out the StaticMeshDemo and it's exactly the same. Can't jump on terrain, but you can jump on boxes. I guess I have to look at how IsSupported is calculated.

Re: Player moves real slow on StaticMesh

Posted: Tue Apr 26, 2011 8:40 pm
by Norbo
The CharacterController isn't supposed to be the default character controller choice at the moment (it was included by accident after I was doing some research for the new version). The preferred option is the SimpleCharacterController.

CharacterController does not currently use non-entities as supports, so you can only move using 'air control' and you can't jump when standing on a mesh. SimpleCharacterController is able to use non-entities as supports.

v0.16.0 is slated to include a new character controller which should be significantly more robust than either current option.

Re: Player moves real slow on StaticMesh

Posted: Tue Apr 26, 2011 8:55 pm
by Dart
Oh awesome. Thank you!