Unity3D export to Android with transparent background?

Thank you very much!

Got it working on iOS by following this steps and adding the next code

- (void)preStartUnity {
  self.window.backgroundColor = [[UIColor clearColor] colorWithAlphaComponent:0];
}

2020.1.9f1

i made the background transparent but i want to make it so that you can control your phone while the app is open
but only where there are no ui elements such as, the app is open, the background is transparent and i was on the home screen opening the appā€¦ now i want to swipe to go to a different page of the home screen.

How can i Do This?

You canā€™t do that, afaik.

okā€¦

Hi, is it possible to achieve this with Unity 2019.4.31f1, cannot find the ā€œPreserve frame buffer alphaā€ option.
Thanks

Doesnā€™t work in 2022.1.8.f1
Exported as android project, made fixes in manifests and styles.xml but it doesnā€™t help

Hi do you guys know how i could filter touches? Like if the user clicks on a button it registers it and if he or she clicks on the transparent parts, then the interaction is on the app on the background?

Unity2021.3.11f1
1.Iā€™m Success by Click


2.Change Default theme
3.build apk

I managed to render the unity frame inside a react native application with transparent background, despite htat this take me to ā€˜brokeā€™ the application because of AndroidManifest merge conflict during building. The conflict happen for the android:theme attribute: the base AppTheme and the Unity.Translucent canā€™t coexist in . So i replace the AppTheme with Translucent in AndroidManifest and everything works except for the app boot where it appears transparent before loading the view.

This is the merged manifest after replace. blue section is UnityManifest and red seciont is React Native manifest.

8683041--1170720--ReactNative_Unitty_mergedAndroidManifest.PNG

I did this and it works, but is there a way to apply post processing effects over the Native UI to saturate or desaturate it. If no, can I achieve that any way, custom shaders? Anything? I want post effects to work for the Android screen. Pls help

Can you do the same (transparent background) on an iOS app?

I included a Unity3D game into my native Android app inside of a FrameLayout. I am trying to get the background of the Unity content transparent such that only the 3D Object is visible. Iā€™ve already tried the following:

In my Unity Project
I set the Camera ā€˜Clear Flagā€™ to ā€˜Solid Colorā€™ and chose #000000 as the color (0 alpha).
In the ā€˜Player Settingsā€™ Iā€™ve checked the option Render over native UI.

Opened the exported Unity project in my Android studio
besides the necessary configs for the library part I tried out various things to get the transparent behaviour working. Iā€™ve tried creating custom styles setting translucient and transparent color and assigned it to the Activity in the AndroidManifest. Iā€™ve tried to set the Z order of the view in the OnCreate Method. Iā€™ve try to set the background color of the mUnityPlayer manually in the OnCreate method. But all that didnā€™t work. The Unity content inside of my native android app always renders with the color Iā€™ve selected without setting the alpha value to 0.

I would be more than thankful if anyoune could provide some help on this.

Hi,Iā€™m using 2021.3.21f1.
refer to https://issuetracker.unity3d.com/issues/android-crash-when-using-unityplayer-getapplicationcontext-this-on-exported-andoid-projects
the background is transparent when I using ā€œnew UnityPlayer(this, this).ā€
but Itā€™s not work when I using ā€œUnityPlayer(getApplicationContext(), this);ā€
how to solve this problem?

Hi, Can you share you demo project?

Hello, has anyone succeeded in including their Unity project in a native Android application with a transparent background? I have tried all the tips on Unity 2022.3.35, and nothing works. Thank you in advance for your help.