Noise and pickup Listeners
I'm playing with some listeners like Noise and pickup object listeners and i have a problem.
IWorldEventListener botHearNoiseListener = new IWorldEventListener() {
@Override
public void notify(HearNoise event) {
//escoltar si hi ha soroll pel voltant, d'on ve, com ha sigut produit...
body.getCommunication().sendGlobalTextMessage("Noise source: " + event.getSource().toString());
body.getCommunication().sendGlobalTextMessage("Noise type: " + event.getType());
body.getCommunication().sendGlobalTextMessage("Noise rotation: " + event.getRotation().
body.getCommunication().sendGlobalTextMessage("Noise distance: " + event.getDistance());
}
};
the 2 last code lines (rotation and distance) doesn't work until the bot dies. if i shoot him with the shootgun he dies and i can see the rotation and distance but if i shoot near the bot the rotation is 0.0, 0.0, 0.0 and the distance is 0.
Does anyone know why this happens?