From yesterday I was looking for a way to disable some behaviour in Gdx-Ai, I wrote code like this:
arriveSteeringBehaviour = new Arrive<Vector3>(character, MainCharacter.getTarget()) //
.setTimeToTarget(0.1f)
.setArrivalTolerance(0.0002f)
.setDecelerationRadius(8);
arriveSteeringBehaviour.setEnabled(true);
character.setSteeringBehavior(arriveSteeringBehaviour);
when "Arrive Distance" <= "Deceleration Radius" I'm trying to disable the Arrive Behaviour like this
if (arriveSteeringBehaviour.getDistance() <= arriveSteeringBehaviour.getDecelerationRadius() ) {
arriveSteeringBehaviour.setEnabled(false);
character.setSteeringBehavior(null);
}
but it's doesn't worked, character object still moving around, anyone can figure this out? thanks
note: in update method, I did disable any translation also disabled character.update(GdxAI.getTimepiece().getDeltaTime()); line.