Moving an Object around

I am trying to move an object ( to be exact Oto from the examples ) around. Or better said i want him to walk around. The animation is not the problem… Its more that he doesn’t react on collision if i use motion path to move him around.

i made a class ( it extends RigidBodyControl) for his attributes:


public MyCustomObject(int health, float speed, float mass, AssetManager manager) { = health;

this.speed = speed;

this.mass = mass;

model = manager.loadModel(“Models/Oto/Oto.mesh.xml”);






private void createModel_phy() {

CapsuleCollisionShape capsule = new CapsuleCollisionShape(1.5f, 2f);

character = new CharacterControl(capsule, 0.01f);



this.setPhysicsLocation(new Vector3f(-140, 9, -10));;


private void createPath() {

path = new MotionPath();

path.addWayPoint(new Vector3f(-140, 9, -10));

path.addWayPoint(new Vector3f(-140, 9, -30));

motionControl = new MotionTrack(model, path);


motionControl.setRotation(new Quaternion().fromAngleNormalAxis(0, Vector3f.UNIT_Y));




And that’s how i create him in my Main method:


MyCustomCreep mCC = new MyCustomCreep(100, 1, 2, assetManager);




As long as i don’t move him he “collides” but as soon as i let him walk around (by “playing” the motionControl) he literally walks through walls.

Is there a better way to let him move then creating a path? or what am i doing wrong?

If you need more code just ask. i tried to shorten it to the relevant…

You cannot use animation paths on characters, make it a kinematic RigidBody for that or use the new KinematicRagdollControl.

1 Like

Yeah the MotionTrack does not support physic enabled objects, maybe there should be something special for the character control that only change the walkingDirection of the characterControl according to the path…

hmm would be nice… But anyway with your hint i got it working now and its still very convenient :slight_smile:

I really appreciate your work (and your help :slight_smile: )

Let’s see if i can implement an A* algorithm for pathfinding…