Tag Archive for Unity

Unity Android Key Mappings

If you are using Unity to develop for Android platforms, you may be wondering what keys the different buttons map to. I happened to find the answer in a location unrelated to Unity, but the information is still valid. In order to make touch devices generally compatible, touch and key inputs are directly mapped to mouse and keyboard buttons respectively. Below is a short table snagged from a Google Group

  • One finger tap = left mouse button
  • Two finger tap = right mouse button
  • Menu key =
    • Middle mouse
    • Windows key
  • Home button = HOME key
  • Back button = ESC key
  • Power button = END key

Note:

After testing with my tablet, I could not confirm any other keys besides the back button. The menu key did not even show up.

Particular Problems with Public Variables in Unity

The Unity documentation it indicates that all public variables are made available in the inspector for direct editing. While this is handy, it is also dangerous. This article will cover a few things regarding public variables, and how to avoid them in Unity.

Read more

Avoiding Long Compile Times

Long compile times are a real chore when it comes to testing things. It is especially cumbersome when all you are doing is making small edits resulting in 2 seconds worth of editing, and 2 minutes waiting for compiling.

Read more

Unity Docs Design Updated

I would just like to make note that the Unity Scripting Docs have been updated. You may be wondering what exactly was updated, it seems to function the same as before. Force a refresh (Ctrl + F5 or Shift + F5) and look at the navigation bar at the top. See the new colors and layout? This is actually a significant improvement. The navigation buttons are now all on the left side above the other navigation bar, not only this but the bar below the main navigation bar is a different color which matches the currently active tab. The text color has also changed. The consistency, layout, and contrast provided by this update actually make the docs more usable. Doubt it? Well, for starters, I didn't even realize that on the sub-bar there was a link to switch from the script documentation of a class to its component documentation until after this change. Did you know that link existed?

Unity Docs Design Updated

I would just like to make note that the Unity Scripting Docs have been updated. You may be wondering what exactly was updated, it seems to function the same as before. Force a refresh (Ctrl + F5 or Shift + F5) and look at the navigation bar at the top. See the new colors and layout? This is actually a significant improvement. The navigation buttons are now all on the left side above the other navigation bar, not only this but the bar below the main navigation bar is a different color which matches the currently active tab. The text color has also changed. The consistency, layout, and contrast provided by this update actually make the docs more usable. Doubt it? Well, for starters, I didn't even realize that on the sub-bar there was a link to switch from the script documentation of a class to its component documentation until after this change. Did you know that link existed?

The Case for C# in Unity

I would like to take this post to explain why using C# in Unity is a better idea than Javascript. If you end up not needing multiple returns for functions, non-type-specific logic, or are okay with the wonky auto-completion for Javascript, then that is okay. On the other hand, if you want to take advantage of those features, and more read on.

Read more

Important Notes on Touch Input in Unity

There are a few things that you will want to keep in mind when working with touch in Unity. Mobile devices pass click events with their touch events, platform dependent compilation, rotations are a special type all their own, sometimes Unity hands back one thing when you need another, collisions are odd, and much more. This is the first of many posts on the quirks of Unity.

Read more