- Home /
After Idle Do x
I want to essentially make a game start screen, when no button is pressed for x time, it starts playing a video. However, while I can get it to start the video I don't know how to reset the idle back to 0 after a button is pressed.
I tried coding this and I have actually deleted that portion of code since then.
Answer by Ludiares.du · Oct 08, 2011 at 07:34 PM
rough code, not tested.
if(Input.GetAnyKey)
{
idletime = 0;
}
Thank you, that worked great. However, I am having one issue and that is when I pause the game. Since Time.time = 0 nothing gets incremented so it will never play the video. Is there a way to increment while Time.time = 0?
This also worked well for me. Setting idletime to 0, then incrementing or subtracting it in an update function(wrapped in an if statement) was the answer for me. Thanks for this hint!
Your answer
![](https://koobas.hobune.stream/wayback/20220613001805im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
SendMessage walk has no recieveer 4 Answers
Can I put elements on top of a FullScreenMovie? 1 Answer
Fetching a Video Ad Before the Ads Scene is Loaded 0 Answers
3D Video within Scene 1 Answer
How to make sure everything's working fine in Unity Ads? 0 Answers