Why is my code only reading the first condition and not checking for the second condition on my code.
def primary():
if keyPress.positive:
if raySensor.hitObject['primaryWeapon']:
own['primary'] = raySensor.hitObject['weaponName']
elif raySensor.hitObject['secondaryWeapon']:
own['secondary'] = raySensor.hitObject['weaponName']
primary()