The issue comes up after the conversation is finished. The "X" input action always seems to register as false after the conversation. It works fine before, but afterwards it just doesn't work.
Things to note:
- Input debugger shows it is being pressed
- There is only one conversation in the scene, attached to this object.
- The input stops after the conversation ends. It still correctly registers as true while the conversation is going.
- It is only this input that stops working. It is the only one I have registered with the input device manager.
I am using a player input component, and the code looks like this.
Code: Select all
if(GetComponent<PlayerInput>().currentActionMap.FindAction("X").ReadValue<float>() == 0)
{
// not pressed
}
else
{
// pressed
}
Just wondering if anything in the dialogue system might be affecting this. Any help is appreciated. Thanks!
Edit: Forgot to mention, the button still works with re-starting the conversation. That is, once I've finished the conversation, the button won't register to anything else anymore, but will still work with the dialogue system. In the registration demo script, there's this comment.
Code: Select all
// Track which instance of this script registered the inputs, to prevent
// another instance from accidentally unregistering them.
Edit 2: I think that I found the source of the bug! To make "X" click the continue button and progress the text, I followed this post:https://www.pixelcrushers.com/phpbb/vie ... php?t=6167
In it, I had to use the "UI Button Key Trigger" Script, and attach it to the Continue button object in the dialogue prefab. Once the text was over, I enabled the continue button and all of its parent's, and the X button worked again! I suspect that the "Input Action" field is somehow conflicting with the other instances of my action map. However, I'm still not sure how to fix this without enabling all of the button's parents afterwards, or why this is even happening.
Edit 3: I was able to fix the issue! I edited part of the "UI Button Key Trigger" script that disables the Input Action when the script is disabled. Since the script is disabled at the very end of the conversation, it also disables the use of the "X" key. However, I don't love editing code written by someone else and I'm worried it might break something else or lead to memory leaks or something. If there's a more established way to do this, please let me know. Thanks!