ConvexShape shape = getShapeFor(entity);
if (shape != null && location != null && trigger != null) {
float scale = location.getWorldScale();
shape.setLocalScaling(new Vector3f(scale, scale, scale));
List<CollisionGroup> detectGroups = Lists.newArrayList(trigger.detectGroups);
PairCachingGhostObject triggerObj = createCollider(
location.getWorldPosition(),
shape,
StandardCollisionGroup.SENSOR.getFlag(),
combineGroups(detectGroups),
CollisionFlags.NO_CONTACT_RESPONSE);
triggerObj.setUserPointer(entity);
PairCachingGhostObject oldTrigger = entityTriggers.put(entity, triggerObj);
if (oldTrigger != null) {
logger.warn("Creating a trigger for an entity that already has a trigger. " +
"Multiple trigger pre entity are not supported. Removing old one. Entity: {}", entity);
removeCollider(oldTrigger);
return false;