Keyboard Controls

This is probably a simple enough issue but google has been unsuccessful.

I am going through the Space Shooter tutorial and have hit a snag. I set the target to Windows Store app as that is what I am intending to do rather than the Web Player. Everything is great until I build it to Visual Studio 2012 (Premium) and run it from there on my local windows 8.1 pro machine.

If I run the game in Unity then it all works great but from VS the keyboard controls don’t work.

I assume I am being dumb, can anyone point me at the solution?

Many thanks,
Neil

Do all keys don’t work, or only some of them?

No input works at all. I thought Unity gave you keyboard input for free but I am guessing I may have to hook something up.

As I mentioned, it works if I play in Unity but not if deployed from VS to my local machine. I think I am doing something really stupid but cannot figure out what! I have found a video on the MS site that might help me but haven’t had a chance to look yet.

Thanks for any tips!

Could you post the code you use to gather the input events? Hard to tell what’s wrong without it.

I think that might be where I am going wrong. The only code I have is the code from the space shooter demo. I think that by just changing the target to Windows Store I’ve missed an important step?

I guess the question I have is… Do you have to write code to capture input events if targeting windows store but not if targeting the web player?

In case you haven’t guess I am a complete newbie when it comes to this, I’ve been doing C# since it came out but Unity for about 2 days!

No, the input code should be the same. However, the code might do different things according to a platform it runs on. For example, it might think that Windows Store is touch only platform and ignores all the keyboard events explicitly. Did you try to debug it with VS?

OK, I’ve figured it out. I’m a muppet.

I had it targeted on Windows 8 not 8.1. I’ve switched it to 8.1 and it is now working.

Thanks for trying to help.

That’s strange, as the shouldn’t be a difference between Win 8 and 8.1.

Later on today I will switch it back to 8 and see if it breaks again. If it does I’ll upload the project. I am using 4.6, not sure if that is anything to do with it.