A few questions here actually:
I have an iron sight animation that mostly works using this code:
if iron_sight_s.positive and own["iron_sight"] == 0: print("IRON_SIGHT") speed = 1 cont.deactivate(run) cont.activate(iron_sight_a) own["iron_sight"] = 1 if not iron_sight_s.positive and own["iron_sight"] == 1: speed = 2 print("iron_end") cont.activate(iron_sight_a) own["iron_sight"] = 0
However, a few problems. I don’t want iron sight to be a toggle, I want you to have to hold down the key to iron sight, although I do have the action as a “ping pong” in my logic block, but I was hoping the python code could play the action back to beginning when I release the key.
Also, I was hoping to disable iron_sight entirely when I am running, by either disabling the sensor (which doesn’t seem possible?) or somehow disabling the actuator for the duration of the run. Is the only way to do that by setting up states in my logic editor (which I THINK will work)? Or can I do that in python?
My blend can be downloaded from here: