Using a couple of tutorials, I have spawned a series of 10x1x10 (x, y, z) floors, 10 panels long and I’ve spawned the golem from HelloAnimation on top of it. The goal is to make a 2.5d side-scrolling game. However, whenever I spawn the golem he vibrates in place and slides very slowly toward the edge of the platform. I have not attached any actions that could be affecting him or the world, not are there and physics aside from gravity on launch.
It is a CharacterControl. The golem is spawned and oriented via the following code:
// Load any model
Node myCharacter = (Node) assetManager.loadModel("Models/Oto/Oto.mesh.xml");
rootNode.attachChild(myCharacter);
// Create a appropriate physical shape for it
CapsuleCollisionShape capsuleShape = new CapsuleCollisionShape(1.5f, 6f, 1);
CharacterControl myCharacter_phys = new CharacterControl(capsuleShape, 0.01f);
// Attach physical properties to model and PhysicsSpace
myCharacter.addControl(myCharacter_phys);
bulletAppState.getPhysicsSpace().add(myCharacter_phys);
myCharacter_phys.setPhysicsLocation(new Vector3f(0,10,0));
myCharacter_phys.setViewDirection(new Vector3f(1,0,0));
This loads the model, attaches a capsule collision shape, adds the physics and sets the golem to spawn 10 units above the leftmost floor panel facing down the line of panels.
I don’t see any methods for sleeping or friction attached to myCharacter_phys or any other related object. Can you explain a bit more?
Ah you already use a character controll, well its not raly physical its pseudo physic, but should usually be more stable for stuff like this. You could try a different stepsize aybee?
I’ve tried a fair amount of things over the past day or two. Friction, gravity, etc. don’t affect the vibration. When I switched the CapsuleCollisionShape for a BoxCollisionShape, the character stopped vibrating but sunk into the ground slightly. I’m willing to make the entire file available, if anyone thinks it would help.