I’m trying to use the same key on 2 actions which are mapped in 2 contexts. When the key is pressed (and consumed), it will remove 1 context and then add the other. There’s some code for the action in the other context. I thought it would only run after the next key press but that’s not the case. I needed to use a delay node between removing and adding.
Here’re the steps to try it out.
- Create an Input Action, ActionA (trigger by pressed)
- Create an Input Action, ActionB (trigger by pressed)
- Create an Input Mapping Context, ContextA mapping ActionA to G
- Create an Input Mapping Context, ContextB mapping ActionB to G
- Add ContextA to a blueprint
- Add an EnhancedInputAction ActionA node: remove ContextA and then add ContextB
- Add an EnhancedInputAction ActionB node: print a string
- Run the code and press G once
If switching contexts is properly ordered, the string in step 7 shouldn’t be printed. If a delay node of 5s is added between removing and adding context, the string is not printed. Is it intended?