I want my PC to get hit by lightning when he grabs the wrong key. I’ve attached screenshots of my events. Currently, when Player comes into collision with WrongKey, it switches to frame 0 of the Lightning animation but does not play the rest. When Player is no longer in collision with WrongKey, the animation goes back to Walk or Idle (as applicable). I had the same problem with Jump at first, and managed to fix it, but that same fix did not work for this. I looked through this forum and saw a lot of this, but none of those fixes worked for me.
I also tried using position events instead of collision, have tried with and without “Trigger once while true”, and it did the same thing. I’ve also tried all of these things both in Scene Events and AnimationByAction. I had more trouble with it in Scene Events, so I landed on the external events. I’m sure I’m missing something obvious, but my brain is done. Any help is appreciated.
You’re using “If one of these conditions is true”, which should not be used in this case.
When the player collides with WrongKey and the animation changes to “Lightning”, that DOES NOT stop the “If one of these conditions is true” condition from being set as true - as the animation is STILL NOT “Fall”, so ONE OF THE CONDITIONS IS TRUE.
You should have the “If all the conditions are true” condition.
The reason why it works for the Jump is probably because when “Fall” is playing the Player is NOT touching the floor, so it doesn’t affect it. It’s not because the “If one” condition stops it; it doesn’t.
It won’t work with your “Lightning” animation, because your events are still being triggered. The game wants to set the position to “Idle”, but also wants to set it to “Lightning”.
Maybe instead of using “If one of these conditions is true” you could just… keep only the two subconditions? You can have more than one condition in the same event block AS LONG as they don’t clash.
And alternatively, you could just replace “If one” with “If all”, found in “Advanced > And”, if you like the subconditions.