i have character
character have:
character control
riggid body control
public GameUnit(String name,String model,String id,LevelAppState appState,Vector3f postion){
this.name = name;
this.appState = appState;
this.model = model;
this.id = id;
spatial = this.appState.assetManager.loadModel("Models/"+this.model+".glb");
spatial.setName(id);
this.appState.npcNode.attachChild(spatial);
SphereCollisionShape sphereShape = new SphereCollisionShape(2.0f);
character = new CharacterControl( sphereShape , 1.2f );
spatial.addControl(character);
ghost = new GhostControl(CollisionShapeFactory.createDynamicMeshShape(spatial));
spatial.addControl(ghost);
this.appState.bulletAppState.getPhysicsSpace().add(ghost);
this.appState.bulletAppState.getPhysicsSpace().add(character);
character.setPhysicsLocation(postion);
Node monsterNode = (Node)spatial;
Node armature = (Node)monsterNode.getChild("Armature");
animComposer = armature.getControl(AnimComposer.class);
animComposer.setCurrentAction("stand");
spatial.addControl(new UnitControl(this));
CollisionShape shape = CollisionShapeFactory.createMeshShape(spatial);
RigidBodyControl rig = new RigidBodyControl(shape, 0);
spatial.addControl(rig);
rig.setKinematicSpatial(true);
this.appState.bulletAppState.getPhysicsSpace().add(rig);
}
but when characters collide they run across each other
how to make them stop on collision
like landscape
?