Hey everyone!
I'm currently trying to implement a simple minigame on AC using quick time events following this tutorial, but between the new input system and the specifics of my minigame it's not really working. The minigame is based on a breathing exercise, so the player has to press a key for inhaling for 4 seconds (with little error margin) then another key to "hold their breath" for 7 seconds, and then another key to "exhale" for 8 seconds. If the player fails the game restarts, and the player has to successfully complete the cycle 3 times. (This is all I've managed to make and you always fail, and this are my input actions and this is my active input))
I was wondering if there's still a way to do so with AC or should I try to script something or change the minigame to something more similar to the tutorial.
Thank you!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
It might be a case of setting the Control Type to Button, but to know for sure if this is an issue with Input System or not - do you have an issue with the legacy Input Manager?
I don't think I have an issue with the legacy Input Manager. I think it's more that I don't quite understand how it's done. It still only fails (I changed it to button), I'm not entirely sure how to make it so that the player has to press until a certain point in order to get it right. I don't know if you could help me. My idea is that an NPC tells you to breathe in, after 4 seconds tells you to hold and after other 7 seconds they tell you to exhale, at the same time the cutscene I'm setting up should show the arrows that you need to press (through the use of the canvas ui) and if the player doesn't do the correct pressing of buttons it restarts. Any idea how that could be achieved? Thank you again.
I'm not sure if this'll help, but I've set up this action list and inputs so far and I only manage to get the "you failed" box to light up on the ActionList Editor, I'm not sure I am on the right track with the use of a global float variable that the actionList increases on a loop while checking if the input is pressed to count the time that the player presses a key.
Avoid the use of the Input: Check Action in a loop - the QTE Action is intended as a replacement for this.
Have you recreated the tutorial before modifying it to suit your own needs? I'd recommend making sure that works before anything else - as well as Input Manager, the screenshots still show the use of Input System.
I recreated the tutorial and it doesn't work. The Input: QTE lights up, and the slider works, but the button animation when hit doesn't work and pressing the button 5 times in 4 seconds doesn't make you win. The only thing I can't manage to do is setting the Animator of the QTE_Canvas exactly the same (I'll add a screenshot bellow) Since it won't allow me to delete the "Any State" or "Entry" (The "New state" linked to "Entry" is the default state)
Here are the screenshots of the action list, QTE Prompt menu and Input manager
I've also kept trying with the hold key QTE type, either with the Input system or with the Input manager. On the action list editor of the game's cutscene it said "The Menu's UI must have an Animator with two States: Win, Lose, and 1 Trigger: Held, I'm not sure I understand this instructions, I've added the "Win" and "Lose" States and created a Trigger parameter named Held (I think that's what it means) but I don't quite understand where the trigger should be?. Here's what I've got. (It also won't display the animation of the Canvas when you hit the key or let you win)
This is a "Hold Key" QTE - you'd need to hold the down button for 4 seconds, rather than press it 5 times.
When testing with Input Manager, have you removed AC's Input System integration objects and enabled "Both" in the Project/Player settings "Active Input Handling" field?
Sorry, that should be a Bool parameter named "Held". This will be set to True when the input is detected.
Yes, when testing with Input Manager I removed the input's control reader. and enabled both in the project settings.
I've tried both with a QTE Hold Key for 4s and with the Button Mash QTE type with a 4s duration and 5 target # of presses. Neither show the animation or get the win response. Here are the screenshots of the ActionLists and this is of the animator
When creating the Bool parameter do I need to link it to something or it works by just adding it?
The Hold Key variant needs a non-zero "Required duration" value - this represents how long to hold the key for, while "Duration" represents the length of the QTE itself.
I cannot recreate issues with either type on my end, however. What's the exact behaviour you're getting - the game is ending? Check the Console for related messages.
AC will control the value of the parameter based on input - you'll need to reference it in Transitions for it to have a visible effect.
Create a new AnimationClip to represent the "Held" state, and transition to it from Default when "IsHeld = true", and vice-versa when false.
I get the end game behaviour. I changed the required duration to 4 on the Input:QTE but I still get the same behaviour. I added am Animation clip for the held state, but I might be linking it wrong, I added the transition from "HeldAnimation" to the default state with the held: false condition and a transition from default to "HeldAnimation" for Held: false. The Canvas UI has an Animator with two AnimationClips: One for Held, which enlarges the icon, and one for NotHeld, which makes it smaller again. The animations work, but they don't respond to the hold key input, they play automatically when I run the game. When I run it with the animator window open I can see the default state light up and in the game window I can see it plays the NotHeldAnimation clip, and then it goes automatically to the HeldAnimation, and plays it one time.
The console displays this message: "A local EventSystem object was found in the scene. This will override the one created by AC, and may cause problems. A custom EventSystem prefab can be assigned in the Menu Manager.", so I tried it removing the EventSystem for the scene, but it didn't change anything.
Also, should I remove the QTE_Canvas prefab from the scene?, when I remove it no animation is displayed on the game window when running the game, the canvas appears and after 4 seconds disappears.
This are my two transitions
Thank you!
Uncheck Has Exit Time in your transitions - otherwise, the animations will need to play in full before they can transition.
The QTE_Canvas prefab will need to be removed from the scene. So long as you have a Menu with this name, which has this prefab assigned in its Linked Canvas prefab field, then the Action will spawn the Menu in at runtime.
Regarding input: try the most basic QTE type, "Single Keypress". Does that work?
It still doesn't work, even with "single keypress", once I play the cutscene no animation is played and you still only get the game ending behaviour. The only messages on the console are related to the fact that there's no player in the scene, I don't really know how that could relate to the problem, but thought I should tell you anyways, one is "No Player found - this can be assigned in the Settings Manager." and "Both a Player and a Hotspot Detector on that Player are required for Hotspots to be detected by 'Player Vicinity'"
It's likely very simple, but I can't tell what the input issue is without seeing it for myself. If you can create a .zip of your project, you're welcome to PM it to me to look at.