Open JonEhh42 opened 8 years ago
val TARGET_BONES = arrayOf(Bones.HEAD, Bones.NECK, Bones.UPPER_CHEST, Bones.LOWER_CHEST)
And surround lines 34-45 with for (targetBone in TARGET_BONES) {
and end with }
. Then replace val ePos = e.bonePosition(TARGET_BONE.id)
with val ePos = e.bonePosition(targetBone.id)
Overall it should end up looking like this:
for (targetBone in TARGET_BONES) {
val ePos = e.bonePosition(targetBone.id)
val distance = distance(myPosition, ePos)
calculateAngle(Me(), myPosition, ePos, aim.reset())
normalizeAngle(aim)
val pitchDiff = abs(angle.x - aim.x)
val yawDiff = abs(angle.y - aim.y)
val diff = sin(toRadians(pitchDiff.toDouble())) + sin(toRadians(yawDiff.toDouble()))
val delta = abs(diff * distance)
if (delta <= FOV && delta < closestDelta) closestDelta = delta.toInt()
}
It still does not shoot feet or legs. Please advise.
@jonfatino Its because they're not included in the array of bones use
val TARGET_BONES = arrayOf(Bones.HEAD, Bones.NECK, Bones.UPPER_CHEST, Bones.LOWER_CHEST, Bones.LEGS, Bones.FEET)
Is there a way to get the BoneTriggerPlugin to support multiple targets? Example -