- Home /
Input doesnt work in standalone build
This is an extremely annoying problem, my game works just perfectly in the editor, but when im in a build none of my inputs are working. i have tried
private void Update()
{
if (Input.touchCount > 0)
{
UnityEngine.Debug.Log("Held down a finger");
}
if (Input.GetMouseButton(0))
{
UnityEngine.Debug.Log("Held down mouse");
}
}
in multiple scripts and it gives me nothing. if anyone knows about a workaround with getting the current touch count I'd be happy, or maybe a solution to why my inputs are returning me nothing.
What code are you using besides logs to see if input is actually going through? Because logs won't show up on built games, only on the editor's console, or are you checking the log file in the Data folder of the built game?
Note: I'm assu$$anonymous$$g that when you say, "doesn't work" (in the future try to have a more detailed description of the problematic behaviour), it means that you're seeing nothing in the console, and the code you expected to run is not running or at least doesn't seem like so, thus there's no reaction to your Input checks.
Question. Why did you add the null reference tag to this question but you are not mentioning any null reference errors. Do you have them or not?
actually there is a great asset in the store which lets u see the normal logs in-game right here
oh, im gonna try to have more accurate stuff in the title, im sry.. i tagget nullreference because i am getting a nullreference, but later on when i wrote i realised that it had nothing to do with it, but forgott to remove topic
I see. For the code you're showing there's no reason it shouldn't be running. So here are a couple more questions.
You're checking for touch input on a standalone build, are you running this standalone build on a device that has touch input?
Are you sure the gameobjects and this script's components attached to said game object are not deactivated when you run the game?
Have you tried using other code besides logs to see if there is a response?
Answer by KalleRosendahl · Jul 04, 2018 at 09:33 AM
OK found out that the issue was cassed by TouchScript asset because they are doing stuff with my inputs
@KalleRosendahl I know this was from a while ago, but what exactly was TouchScript doing to your inputs? I'm having a similar issue and am wondering if it's due to the same cause.