Games in Unity
Unity Game on Android Automotive
9 min
introduction with unity airconsole plugin 2 6 0, the plugin now supports android automotive aosp based platforms this platform is in addition to webgl and android tv based platforms to run safely in these environments, meeting their different requirements, significant work was done to support game developers to ensure consistent project configurations and provide native games with additional informations and features the most important feature addresses the situation, that some airconsole android target systems are displaying the game with a full screen resolution even if the system's user interface or the airconsole webview are overlapping depending on the system's user interface state, games also have to handle resizing the available render area to make sure the game is displayed correctly within the available screen space starting with 2 6 0 and initially for cars, we strive to make it consistent and ensure that game developers receive the required information to achieve the highest possible performance configuration setting up the project setting up is relatively straight forward how much work the integration is depends on degree of custom code your game uses ensure that the project is using unity airconsole plugin v2 6 0 or newer on your airconsle, enable native game sizing image showing how to enable native game sizing on the airconsole component in unity implement the airconsole instance onsafeareachanged on all cameras and camera setups in your game in assets/airconsole/examples/safe area , we provide examples for ui camera setups, multi camera splitscreen and custom single camera setups if you need to get the safe area independent of the event, you can access it through the property airconsole instance safearea test that your integration is complete using the new safe area tester (window > airconsole > safearea tester) this allows you to change the safe area while testing in editor playmode if you use android ui resize mode resize camera will automatically handle the safe area of the maincamera (unityengine camera main) resize camera and reference resolution is not supported with native game sizing active to meet your specific needs in ui layout, you will need to implement this yourself we provide an example for ui camera as a possible starting point ensure that all your camera and ui canvas setups use onsafeareachanged , including camera independent overlay canvas setups for more information see usage below once you are done with the integration, create and upload a new unity webgl build to https //airconsole com/developers and update the android game version on the airconsole component to ensure that your screen will be configured correctly verifying your 3rd party dependencies android automotive aosp environments have several key differences to android tv based environments that can have an impact on games built for the google play store please verify the following aspects thoroughly there are no google apis including google play, google analytics and other com google based abilities you need to remove them completely from your game or the game will be able to launch at all this can be verified using an android automotive aosp based android emulator in android studio for example automotive manufacturers need to follow strict security and data protection regulations part of that is that applications are not able to contact whatever web address they want, there is a strict whitelist with everything else being blocked as on all platforms, your game is not meant to use anything not provided by airconsole, which use airconsole com or related subdomains that are whitelisted if you followed this and related release checklist requirements , you are fine if your game depends on 3rd party services not provided by airconsole thus far, please verify beforehand with the airconsole team, if you can continue to use that dependency or what can be done about it for your game to become available on automotive a good example for this are multiplayer game servers if you run them yourself, we can run them in our infrastructure games sent to the store platform potentially need to make legally binding declarations on security and vulnerability aspects for unity and the airconsole plugins we do this, but for third party dependencies, we might need you to provide these we understand from experience that this can be extremely complex, as such we recommend you to have only the native library dependencies and internet based dependencies absolutely necessary that are well enough understood usage onsafeareachanged event the onsafeareachanged event is triggered by the airconsole game platform when the system user interface and/or the airconsole webview overlaps the games render area everytime this event is called new offsets the new render width and height are provided note the safe area can change at any time while the ui and the rendered game must respect the new safe area received in the onsafeareachanged event examples for safe area handling can be found in the unity plugin in assets/airconsole/examples/safe area camera handling as the game is occupying the fullscreen and system overlays are not changing the screen size of the game we have to adjust the area the game renders in by setting the cameras viewport rect the implementation of the onsafeareachanged event in the unity airconsole plugin provides a value of type rect that uses the bottom left relative values that unity uses for camera pixelrect this means for non splitscreen games you can directly pass the value to the pixelrect property of the camera this example expects a variable targetcamera that is containing a reference to the active camera that renders the game in the case of split screens, the safe area needs to be split up to size and scale the cameras the plugin provides assets/airconsole/examples/safe area/splitscreensafeareahandler cs https //github com/airconsole/airconsole unity plugin/blob/master/assets/airconsole/examples/safe area/splitscreensafeareahandler cs as a starting point ui and canvas canvas components that are drawn on screen space need to adjust their visible pixelrect according to the safe area as well to avoid rendering ui outside the visible area for an example to get started, you can check assets/airconsole/examples/safe area/uisafeareahandler cs https //github com/airconsole/airconsole unity plugin/blob/master/assets/airconsole/examples/safe area/uisafeareahandler cs examples examples for common challenges like ui camera setups single camera setups with custom logic multi camera splitscreen setups can be found in the airconsole unity plugin examples assets/airconsole/examples/safe area limitations android projects that do not have a web version live yet require support from the airconsole team once the first version has been uploaded, as android games require at least one live version and a special flag as of unity plugin 2 6 0 on aug 18, 2025 , the safe area only works for supported automotive partners everywhere else it will behave like android tv with the top bar we plan to expand it's support to all android based environments including android tv in a next step