Questions in topic: "android"http://answers.unity3d.com/questions/topics/single/697.html
The latest questions for the topic "android"Android APK freezes during level load but not in Unity Editorhttp://answers.unity3d.com/questions/1395222/android-apk-freezes-during-level-load-but-not-in-u.html
I'm building a mobile game for android, and i've gotten pretty far with no issues. My scenes were loading properly and everything was working fine on both the Unity Editor and the Android APK until recently. I have a "Loading Page" transition into every scene. My game starts off with a splash scene, then loads to the transition "Loading Page" and then to the "Main Page". On both the Unity Editor and the Android APK, these all load fine. In my "Main Page", i have a "Start" button, which when clicked, it loads the "Game Page". In the Unity Editor, when i press the "Start" button everything runs smoothly and it loads perfectly fine. When i build the Android APK and try pressing the "Start" button on mobile, it takes me to the transition "Loading Page" no problem, but then just freezes and never loads the "Game Page". This has only started happening recently, and i have not made that many changes to my game. I went as far as to start a whole new project from scratch and building it all again and starting from today the issue has started again. I am using Photon Network, and thought that maybe that was the issue due to me just recently getting Unity_2017. I removed all Photon Network scripts and all assets from my project and loaded all scenes offline through SceneManager.LoadAsync, and am still getting the same issue.. I've tried loading other scenes other than the "Game Page" after the transition "Loading Page" but still the same issue. I removed all 3D objects from my scenes and even went as far as to removing all 3D objects from the project entirely.
I am confused as to what is going on here. If someone has some kind of answer to this or some way i can try to resolve this it would be greatly appreciated!!!! Please help!!
This is the code i am using to transition from scene to scene through the "Loading Page" :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using UnityEngine.EventSystems;
public class LoadingText : MonoBehaviour {
private AsyncOperation ao;
private int levelToLoad;
private string lastLoadedScene;
// Use this for initialization
IEnumerator Start () {
lastLoadedScene = getLastLoadedScene.getLastLevel ();
if (lastLoadedScene == "SplashNameLoad") {
levelToLoad = 2;
}
else if (lastLoadedScene == "Main") {
levelToLoad = 3;
}
ao = SceneManager.LoadSceneAsync (levelToLoad);
ao.allowSceneActivation = false;
GetComponent<Text> ().text = "Loading";
yield return new WaitForSeconds (0.5f);
GetComponent<Text> ().text = "Loading.";
yield return new WaitForSeconds (0.5f);
GetComponent<Text> ().text = "Loading..";
yield return new WaitForSeconds (0.5f);
GetComponent<Text> ().text = "Loading...";
yield return new WaitForSeconds (0.5f);
GetComponent<Text> ().text = "Loading..";
yield return new WaitForSeconds (0.5f);
GetComponent<Text> ().text = "Loading.";
yield return new WaitForSeconds (0.5f);
GetComponent<Text> ().text = "Loading";
ao.allowSceneActivation = true;
}
}androidunity 5android buildfreezefreezingThu, 17 Aug 2017 20:43:55 GMTJay1234Why is my app hitting the Unity Analytics endpoints if I have analytics disabled?http://answers.unity3d.com/questions/1395205/why-is-my-app-hitting-the-unity-analytics-endpoint.html
I can't figure out why my mobile app is hitting the following three endpoints...
- http://stats.unity3d.com
- http://config.uca.cloud.unity3d.com
- http://api.uca.cloud.unity3d.com
After researching on Google, it appears these three endpoints are associated with either the Unity Analytics services, or the editor analytics (Unity -> Preferences -> General -> Disable Editor Analytics (Pro Only)). I don't have Unity Analytics enabled, and I'm disabling (checkbox is checked) the editor analytics in preferences. Why are these endpoints still being hit and how can I stop it?
I'm using Unity v5.5.2.p2. Sadly, for security reasons, I can't release the app until these network calls are stopped. Thanks in advance for your wisdom!androidiosunity5Thu, 17 Aug 2017 20:11:23 GMTMMVR-2Specular light reflections in android do not render properlyhttp://answers.unity3d.com/questions/1395064/specular-light-reflections-in-android-do-not-rende.html
Hello! I would like to have a very shiny object in a Unity Android project which reflects the directional light as shown in the image. The reflections in the editor look really nice, but when I run the app on an android device (I tried a few devices on android 6 and 7), the reflections are pixelated or distorted with the different shaders. Ideally, I would like the reflection to look like the image in the editor with the standard shader settings, but I cannot find what is breaking it. I played around with the settings of texture compression, quality settings, graphics API, shader settings, but nothing seems to affect this particular issue. I will be very grateful if you share with me ideas where might be the issue and is there a fix / workaround for it.
![alt text][1]
[1]: /storage/temp/100105-specular-light-issue-compressed.pngandroidlightingshadersmobile devicesreflectionsThu, 17 Aug 2017 15:52:50 GMTIvanDDAugmented Reality movement mobilehttp://answers.unity3d.com/questions/1394926/augmented-reality-movement-mobile.html
Hi,
Is there a way to move the camera position in the scene with the smartphone position in real time?
Rotation is easy, I need the position to change so when I walk in real time the camera in the scene will move to.
Or
Make the models stay in place without markers.
Is it possible?androidmovementmobileaugmented-realityThu, 17 Aug 2017 10:09:35 GMTT4l_RStore/Stack Itemshttp://answers.unity3d.com/questions/1394754/storestack-items.html
![alt text][1]I want my game to store (count) the powers ups the player obtains (like angry brids) and display them in the main menu with their icons and also in the game scene trough buttons. It's gonna be a multiplayer game, so should I store them on the device memory or server?
In the img attached you can see what I mean. PS: I don't want, need or mean an inventory system.
Thanks for answers.
[1]: /storage/temp/100043-screenshot-2017-08-17-07-46-17.pngc#androidgui2diosThu, 17 Aug 2017 00:10:18 GMThussein_lkAndroid Movable Objects or Images For a simple gamehttp://answers.unity3d.com/questions/1394519/android-movable-objects-or-images-for-a-simple-gam.html
im making a simple math tutorial app for kids. what i want is to have apples or stuff to be put in basket or anything. i really don't know where to start. 2d/3d game object, i don't know.
i tried some, quad mesh. and rigid body. the thing falls. so now i know how to make it fall and how to make it stop with another. but i don't know if im using the right things. and it doesnt render in a panel.
please help me finish it. thank you.!
Here's a simple illustration i made in powerpoint. (cause i know what i said is confusing)
![alt text][1]
[1]: /storage/temp/100048-sample.pngandroidgameobjectWed, 16 Aug 2017 15:54:47 GMTmacoydolemVideo crashes Unity game on Daydreamhttp://answers.unity3d.com/questions/1394286/video-crashes-unity-game-on-daydream.html
I'm trying to play a video on Daydream in my Unity game. However, the video causes the game to segfault whenever I try to play it. To verify that the video is what is causing the crash to occur, I removed the scene containing the video from my game. Sure enough, everything was working fine once that scene was gone. I am not sure what *exactly* is causing the crash, though. I managed to capture `logcat` output from a running instance of the game via `adb logcat -s Unity ActivityManager PackageManager dalvikvm DEBUG` and the parts that seem relevant to the crash are seen below (I do not wish to post a full dump of the logs since some of the information is private):
...
08-14 07:58:00.197 16524 16617 E Unity : Unable to find AudioPluginOculusSpatializer
08-14 07:58:00.197 16524 16617 D Unity : Unable to lookup library path for 'libaudioplugingvrunity', native render plugin support disabled.
08-14 07:58:00.197 16524 16617 E Unity : Unable to find libaudioplugingvrunity
08-14 07:58:00.207 16524 16617 D Unity : Unable to lookup library path for 'libAudioPluginOculusSpatializer', native render plugin support disabled.
08-14 07:58:00.207 16524 16617 E Unity : Unable to find libAudioPluginOculusSpatializer
...
08-14 07:58:19.257 16842 16842 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-14 07:58:19.257 16842 16842 F DEBUG : Build fingerprint: 'ZTE/P996A01_N/ailsa_ii:7.1.1/NMF26F/20170301.161705:user/release-keys'
08-14 07:58:19.257 16842 16842 F DEBUG : Revision: '0'
08-14 07:58:19.257 16842 16842 F DEBUG : ABI: 'arm'
08-14 07:58:19.257 16842 16842 F DEBUG : pid: 16524, tid: 16671, name: GLThread 513 >>> com.REDACTED.REDACTED <<<
08-14 07:58:19.257 16842 16842 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x20
08-14 07:58:19.257 16842 16842 F DEBUG : r0 00000000 r1 00000000 r2 fffe1a66 r3 72e77f00
08-14 07:58:19.257 16842 16842 F DEBUG : r4 f00f2008 r5 cf5fc900 r6 00000000 r7 cc6fc7e4
08-14 07:58:19.257 16842 16842 F DEBUG : r8 cc6fc828 r9 cc6fc738 sl cf5fc928 fp ce43fa10
08-14 07:58:19.257 16842 16842 F DEBUG : ip cc6fc7e4 sp cc6fc610 lr cd2ae69b pc cd329f58 cpsr 600d0030
08-14 07:58:19.257 16842 16842 F DEBUG :
08-14 07:58:19.257 16842 16842 F DEBUG : backtrace:
08-14 07:58:19.257 16842 16842 F DEBUG : #00 pc 0026ff58 /data/app/com.google.vr.vrcore-2/lib/arm/libvrcore_native.so
08-14 07:58:19.257 16842 16842 F DEBUG : #01 pc 001f4697 /data/app/com.google.vr.vrcore-2/lib/arm/libvrcore_native.so
08-14 07:58:19.257 16842 16842 F DEBUG : #02 pc 001f4821 /data/app/com.google.vr.vrcore-2/lib/arm/libvrcore_native.so
08-14 07:58:19.257 16842 16842 F DEBUG : #03 pc 001f5613 /data/app/com.google.vr.vrcore-2/lib/arm/libvrcore_native.so
08-14 07:58:19.257 16842 16842 F DEBUG : #04 pc 001dd7f1 /data/app/com.google.vr.vrcore-2/lib/arm/libvrcore_native.so
08-14 07:58:19.257 16842 16842 F DEBUG : #05 pc 0001df9d /data/app/com.REDACTED.REDACTED-2/lib/arm/libgvr.so (gvr_render_reprojection_thread+24)
08-14 07:58:19.257 16842 16842 F DEBUG : #06 pc 000a631f /data/app/com.REDACTED.REDACTED-2/lib/arm/libgvr.so (Java_com_google_vr_ndk_base_GvrApi_nativeRenderReprojectionThread+14)
08-14 07:58:19.257 16842 16842 F DEBUG : #07 pc 000b73f1 /data/app/com.REDACTED.REDACTED-2/oat/arm/base.odex (offset 0xab000)
08-14 07:58:20.787 1321 16843 W ActivityManager: Force finishing activity com.REDACTED.REDACTED/com.unity3d.player.UnityPlayerActivity
08-14 07:58:20.797 1321 16843 D ActivityManager: --zc to bg, ProcessRecord{fef975a 16524:com.REDACTED.REDACTED/u0a139} rx/tx = 115341 624574
08-14 07:58:20.807 1321 1386 W ActivityManager: Failed setting process group of 16524 to 1
08-14 07:58:20.877 1321 2828 I ActivityManager: Process com.REDACTED.REDACTED (pid 16524) has died is serviceb: false
...
I have not made modifications to how my video is played on Daydream versus how it is played on desktop, except that I changed the "Importer Version" to VideoClip instead of MovieTexture (which is not supported on Android). What am I missing that could cause a video to crash my game on Daydream?androidvrvideoWed, 16 Aug 2017 11:43:16 GMTgdp2Playing a VR video on Android - Google Cardboardhttp://answers.unity3d.com/questions/1393825/playing-a-vr-video-on-android-google-cardboard-1.html
Hi there,
A short while ago I was able to develop an app that mixed Ar and Vr but still kept normal app looks.. I could sign in without having to use the goggles and navigate through it outside the Vr mode. I did that using an old google cardboard SDK that apparently didn´t require the Vr mode to be on for it to work so my app didn´t have to be on vr mode all the time. However, the most exciting thing was that I was able to play a Vr video using the easy movie texture plugin... this story doesn´t end well...all of the sudden, Im not able to play the Vr video anymore, it is only showing the sphere texture.... I have flipped the normals, used the plugin again... doesn´t work anymore...
Im aware that it is not very straight forward to make an AR/VR app without having the vr mode on all the time, even so when the new GoogleVR SDK REQUIRES the vr mode to be on...but I had managed to do it!
My guess is that unity has made updates that are no longer happy with the functionality of my app..
Any thoughts?? Thanks a bunch in advance.androidvrvideoplayaugmented-realityWed, 16 Aug 2017 11:39:47 GMTjuanitoliUnity and SharedUserID for Androidhttp://answers.unity3d.com/questions/1394421/unity-and-shareduserid-for-android.html
Hi,
I have a parent android app made in Android Studio, which creates a sharedpreference file and lists down a bunch of values/string in those.
I have other android apps which use the values/strings from the above mentioned sharedpreference file from the parent android app.
I am now creating a project in Unity, for which I would like to access the mentioned sharedpreference file. I have included the shared user id in Assets>Plugins>Android>AndroidManifest.xml and I am using the same keystore for all of my Apps (Android and Unity). I tried using PlayerPrefs to try and read from the above sharedpreference file. However, I am unable to do so.
Further reading up on player prefs suggests that it creates a preference file with the name com..xml only.
Any advice on how to proceed from there would be appreciated.
Thanks,
DivandroidplayerprefspreferencesWed, 16 Aug 2017 11:14:14 GMTdkkalaProblem about create shooting button for android in FPS gamehttp://answers.unity3d.com/questions/1394360/problem-about-create-shooting-button-for-android-i.html
Hi
I'm trying from a month ago until now to make a shooting button for FPS game for android devices with easy touch but i failed. And my last hope is there.
When i connect my android device to unity with unity remote without i create button,when i touch anywhere of the screen,player start to shooting.
In input setting shooting is set on mouse 0.
I want create a button,when i touch it player start to shooting.
I use realistic FPS prefab asset.
Please help me.androidtouchscreentouch screenWed, 16 Aug 2017 08:17:58 GMTSinakiHow do you add deep linking shortcuts for Android?http://answers.unity3d.com/questions/1394345/how-do-you-add-deep-linking-shortcuts-for-android.html
In the "new" Android N you get the option to add deep linking shortcuts for your app. In the UnityPlayerActivity.java (after exporting to Android Studio project) I found a onNewIntent(Intent intent) with the comments:
// To support deep linking, we need to make sure that the client can get access to
// the last sent intent. The clients access this through a JNI api that allows them
// to get the intent set on launch. To update that after launch we have to manually
// replace the intent with the one caught here.
It looks possible but is it? And how is it done?androidshortcutsWed, 16 Aug 2017 07:34:07 GMTDoctorTwentyThreeProblem displaying in Android Devicehttp://answers.unity3d.com/questions/1394301/problem-displaying-in-android-device.html
![alt text][1]
Hi
i saw this problem in just main menu scene after i run on my android device.
Is there any way to solve this problem?
thanks.
[1]: /storage/temp/99981-photo5810130689314630284.jpgandroidWed, 16 Aug 2017 05:06:33 GMTafra-franticSwitch PC Controls to Android ?http://answers.unity3d.com/questions/1394174/switch-pc-controls-to-android.html
Hello I have a script that work perfectly on PC platforms
The character move to the left or right with A and D key
But i'm trying to make it work on Android to.
I tried Accelerometer but it doesn't work as intended so I end up adding 2 button Left and Right and the player will have to touch it to turn the character left or right
Here is my code :
using UnityEngine;
public class PlayerController : MonoBehaviour {
public float moveSpeed = 10f;
public float rotationSpeed = 10f;
private float rotation;
private Rigidbody rb;
void Start ()
{
rb = GetComponent<Rigidbody>();
}
void Update ()
{
rotation = Input.GetAxisRaw("Horizontal");
}
void FixedUpdate ()
{
rb.MovePosition(rb.position + transform.forward * moveSpeed * Time.fixedDeltaTime);
Vector3 yRotation = Vector3.up * rotation * rotationSpeed * Time.fixedDeltaTime;
Quaternion deltaRotation = Quaternion.Euler(yRotation);
Quaternion targetRotation = rb.rotation * deltaRotation;
rb.MoveRotation(Quaternion.Slerp(rb.rotation, targetRotation, 50f * Time.deltaTime));
//transform.Rotate(0f, rotation * rotationSpeed * Time.fixedDeltaTime, 0f, Space.Self);
}
}
Thank you in Advance
I also use a SmoothFollow on the Camera if it can help anyone
using UnityEngine;
public class SmoothFollow : MonoBehaviour {
public Transform target;
public float smoothness = 1f;
public float rotationSmoothness = .1f;
public Vector3 offset;
private Vector3 velocity = Vector3.zero;
// Update is called once per frame
void FixedUpdate () {
if (target == null)
{
return;
}
Vector3 newPos = target.TransformDirection(offset);
//transform.position = newPos;
transform.position = Vector3.SmoothDamp(transform.position, newPos, ref velocity, smoothness);
Quaternion targetRot = Quaternion.LookRotation(-transform.position.normalized, target.up);
//transform.rotation = targetRot;
transform.rotation = Quaternion.Lerp(transform.rotation, targetRot, Time.deltaTime * rotationSmoothness);
}
}c#androidmovementbuttonTue, 15 Aug 2017 19:52:30 GMTPalass64How to ignore touches on a layerhttp://answers.unity3d.com/questions/1394117/how-to-ignore-touches-on-a-layer.html
I'm making an android game in which you move the camera by dragging the screen and rotate it with a virtual joystick, the problem is when i use the joystick the camera moves. So, how can i ignore the touches on the joystick, which is on a different layer?
I put the drag to move code below.
` if (Input.touchCount != 0)
{
if (Input.touchCount == 1 )
{
Touch touch = Input.GetTouch(0);
Vector2 TouchVec = touch.deltaPosition;
if (TouchVec.x >= 10 || TouchVec.y >= 10 || TouchVec.x <= -10 || TouchVec.y <= -10)
{
transform.position = new Vector3(Mathf.Clamp(transform.position.x - TouchVec.x, -150, 150), transform.position.y, Mathf.Clamp(transform.position.z - TouchVec.y, -100, 100));
}
}`androidtouchlayersTue, 15 Aug 2017 16:58:46 GMTDelgh1android game is laggyhttp://answers.unity3d.com/questions/1393919/android-game-is-laggy.html
hi,i made a 2d game but its jerkish and laggy somethimes,below I provided images of my profiler below,please check it out and help me with the lag!! Thank Youalt textandroidlagTue, 15 Aug 2017 09:46:02 GMTnaclasherBuild for Android O (preview) - target api 26 not availablehttp://answers.unity3d.com/questions/1393684/build-for-android-o-target-api-26-not-available.html
I'm using Unity 5.6.1f1 and already installed api 26 (android O) into my android-sdk folder, but the player settings won't allow me to select it as the target api level, it allows me only to select up to level 25.
![alt text][1]
Is this because Unity doesn't support api 26 yet? Is there a build of Unity available that does? In general for future cases, will building for android previews work in Unity?
[1]: /storage/temp/99905-unity-no-target-api-26.pngandroidbuildMon, 14 Aug 2017 19:00:55 GMTocundanganHow to use Alljoyn to make multi-play gamehttp://answers.unity3d.com/questions/1393626/how-to-use-alljoyn-to-make-multi-play-game.html
I wanna make AR multi-play game with Vuforia so i tried some networking services(f.g PUN,UNET) but it doesnt work.
But actually i found that there are some AR multi-play games so i think to make AR multi-play game is possible.I hope so at least.
And I noticed that I can make AR multi-play game with Alljoyn but to use it in Unity is difficult for me.
I can't import Alljoyn in Unity at first.
If you know how to use it in Unity,Pls tell me.androidiosmultiplayermultiplayer-networkingMon, 14 Aug 2017 17:04:01 GMTKiyoshi35How to open a url in VR Browser from a Gear VR app?http://answers.unity3d.com/questions/1393539/how-to-open-a-url-in-vr-browser-from-a-gear-vr-app.html
Hi, I'm trying to open the VR Browser in a Gear VR app but nothig seems to work. I've tested with:
Application.openURL(myURL);
and
AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
activity = jc.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaClass intent_class = new AndroidJavaClass("android.content.Intent");
AndroidJavaClass uri_class = new AndroidJavaClass("android.net.Uri");
uri = uri_class.CallStatic<AndroidJavaObject> ("parse", myUrl);
intent = new AndroidJavaObject("android.content.Intent", intent_class.GetStatic<string>("ACTION_VIEW"));
intent.Call ("setData", uri);
activity.Call ("startActivity", intent);
Thanks :)androidvroculusbrowserMon, 14 Aug 2017 13:30:52 GMTvarumora_everywoahIf the movie is full screen in ios or andorid,will an input field also run?http://answers.unity3d.com/questions/1392495/if-the-movie-is-full-screen-in-ios-or-andoridwill.html
Hello,https://docs.unity3d.com/ScriptReference/Handheld.PlayFullScreenMovie.html
i can understand that movies will be fullscreen in ios or android.
I am trying to make a hud interface with a text editor in the middle of it,the hud interface is just a video and in the middle is the input field(text).Will it work in the fullscreenmode or not ? :(androidiosmovietextureMon, 14 Aug 2017 12:40:42 GMTPaulennonzepplien[SOLVED] Unable to merge android manifests error while trying to build a Gear VR projecthttp://answers.unity3d.com/questions/1393447/unable-to-merge-android-manifests-error-while-tryi.html
This has been driving me crazy all night. I'm trying to build a test project for the Gear VR platform. I have my OSIG file in Assets/Plugins/Android/assets and I have the "Virtual Reality Supported" box checked, and I have "Oculus" set as my VR SDK. I've also set a package name and set my Minimum API Level to "Android 5.0 'Lollipop' (API level 21)". I've got my phone set up for USB debugging, as well. When I try clicking Build or Build and Run, I get an error message saying "Unable to merge android manifests. See the Console for more details."
I'm super new to Gear VR development with Unity and I was hoping someone could point me in the right direction. I've been reading a lot of stuff about how there's supposed to be an AndroidManifest.xml file in my Assets/Plugins/Android folder, but I don't see one there. However, there is one located in the Project/Temp/StagingArea folder.
Following this is what I think might be the relevant console error message. If more information is necessary I can try to provide it:
Q:\Unity Projects\GVRShowdown\Temp\StagingArea\AndroidManifest-main.xml:4:125-150 Error:
Attribute application@debuggable value=(true) from AndroidManifest-main.xml:4:125-150
is also present at AndroidManifest.xml:3:148-174 value=(false).
Suggestion: add 'tools:replace="android:debuggable"' to <application> element at AndroidManifest-main.xml:4:3-12:17 to override.
Q:\Unity Projects\GVRShowdown\Temp\StagingArea\AndroidManifest-main.xml:4:16-57 Error:
Attribute application@theme value=(@style/UnityThemeSelector) from AndroidManifest-main.xml:4:16-57
is also present at AndroidManifest.xml:3:83-147 value=(@android:style/Theme.Black.NoTitleBar.Fullscreen).
Suggestion: add 'tools:replace="android:theme"' to <application> element at AndroidManifest-main.xml:4:3-12:17 to override.
UnityEditor.HostView:OnGUI()androidvrandroid-manifestbuild errorMon, 14 Aug 2017 08:12:18 GMTTRON-dllLoading from streaming assets in obb fails.. but not always.http://answers.unity3d.com/questions/1393344/loading-from-streaming-assets-in-obb-fails-but-not.html
Hello everybody.
In a current android project I want to load an .mp4 video from the streaming assets.
Nothing special about that.. the normal .apk works fine.
The problem starts after splitting the binary for the store.
----------
Here the basics of the problem:
- loading from streaming assets with a splitted apk (obb) fails, when game complete
- levels are loading.. so the obb has been found.
- loading a video works fine, if 2 of the 4 language packages are deleted (doesn't matter which one)
- Therefore: the plugin is also working with an obb and the path is basically correct
- version with 3 language packs and only 1 (instead of 32) videos is not working (although the obb is smaller than the working one = size appears not to be the problem)
Do you have any guesses, tips or even solutions to this?
Seems to me like a building bug, because the (otherwise) working plugin can't find the video file in the right path.
Would be really glad, thanks in advance!
Cheers.
_______________________________________________________
Here the path the plugin is looking for the video (in both cases):
jar:file:///storage/emulated/0/Android/obb/~bundleidentifier~/main.3.~bundleidentifier~.obb!/assets/MainMenu_Video_Android.mp4
The error:
AndroidJavaException: java.lang.RuntimeException: File "assets/MainMenu_Video_Android.mp4"not found in zip
08-13 15:11:59.536: I/Unity(18140): java.lang.RuntimeException: File "assets/MainMenu_Video_Android.mp4"not found in zipandroidvideostreamingassetsvideo streamingobbSun, 13 Aug 2017 22:40:49 GMTCourse-InteractiveHow to change Unity2D aspect ratio with scenes?http://answers.unity3d.com/questions/1393117/how-to-change-unity2d-aspect-ratio-with-scenes.html
I have multiple scenes in my mobile phone, in one scene the aspect ratio must be 16:10(vertical), in other scene it must be horizontal. I made the 16:10, but when I do this, the other scene is 16:10 too. Is there a way where I can change the aspect ratio, from the code? When that scene is loaded, the aspect ratio changes.android2dmobileaspect-ratioaspect ratioSun, 13 Aug 2017 09:59:16 GMTkyhnlbyrkWebCam Texture Rotationhttp://answers.unity3d.com/questions/1393086/webcam-texture-rotation.html
Hi All...
Our "Acting Kindly" mobile game/app allows users to take selfies and share them to Facebook. The intern who wrote the WebCam.cs script didn't add functionality so the camera image rotates with the orientation of the phone. I'm only a beginner when it comes to C# and having trouble figuring out how to do this. I found one post which seems to have a script to do it...but now sure. Here's that post:
http://answers.unity3d.com/questions/773464/webcamtexture-correct-resolution-and-ratio.html?childToView=1148424#answer-1148424
I have two basic problems:
1) Android... the script isn't rotating the camera image when the phone is rotated (to upside down from original position from when it is started) so the image both shows on the camera and posts to facebook as upside-down.
2) iOS...the image is always upside down on the phone compared to what posts. So if it looks right side up...it posts upside down and if it is upside down then it posts right side up.
Here is the script being used that causes the above behavior:
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.IO;
using HutongGames.PlayMaker;
using System;
public class WebCam : MonoBehaviour {
int currentCamIndex = 0;
WebCamTexture tex;
public RawImage currentImage;
public RawImage previewImage;
//public Text filePath;
public Text startStopText;
//stores users full name
private string username = "fUserName";
//image file will be saved with following extension
private string pngExtention = ".png";
public Text debug;
public DeviceOrientation myDeviceOrientation;
private Quaternion quatRotation;
public void StartStopCamera() {
if (tex != null) { // stop the camera
StopWebCam();
} else { // Start the camera
StartWebCam();
}
}
public void Start() {
GetLatestDeviceOrientation ();
//Default Rotationf of RawImage os 0
quatRotation = new Quaternion();
quatRotation.eulerAngles = new Vector3 (0, 0, 0);
}
public void SwitchCamera(){
if (WebCamTexture.devices.Length > 0) {
currentCamIndex += 1;
currentCamIndex %= WebCamTexture.devices.Length;
//filePath.text = currentCamIndex.ToString ();
//if texture is not null then stopcamera and start again
if (tex != null) {
StopWebCam ();
StartStopCamera ();
}
}
}
public void StopWebCam() {
if (tex!=null && tex.isPlaying) {
currentImage.texture = null;
tex.Stop ();
tex = null;
}
}
private void StartWebCam() {
WebCamDevice device = WebCamTexture.devices [currentCamIndex];
tex = new WebCamTexture (device.name);
currentImage.texture = tex;
currentImage.transform.rotation = quatRotation;
tex.Play ();
}
public void SaveImage ()
{
try {
SetDebugText ("Save image started");
if (tex != null) {
Texture2D tempTex = new Texture2D (tex.width, tex.height, TextureFormat.ARGB32, false);
tempTex.SetPixels (tex.GetPixels ());
tempTex.Apply ();
SetDebugText ("before ");
FsmString fUserName = FsmVariables.GlobalVariables.FindFsmString (username);
SetDebugText ("after " + fUserName.Value);
//FsmString fUserName = new FsmString ("SarthakShah");
//fUserName.Value = "SarthakShah";
System.IO.File.WriteAllBytes (Application.persistentDataPath + "/" + fUserName.Value + pngExtention, tempTex.EncodeToPNG ());
byte[] imgData = File.ReadAllBytes (Application.persistentDataPath + "/" + fUserName.Value + pngExtention);
Texture2D imgtex = new Texture2D (tex.width, tex.height);
imgtex.LoadImage (imgData);
previewImage.texture = imgtex;
SetDebugText ("Save image finished");
SetDebugText (Application.persistentDataPath + "/" + fUserName.Value + pngExtention);
}
} catch (Exception e) {
debug.text = e.ToString ();
//username;
Debug.Log (e.ToString ());
Debug.Log (username);
}
}
public Texture2D FillnClear(Texture2D tex2D, Color whatToFillWith){
for (int i = 0; i < tex2D.width; i++) {
for (int j = 0; j < tex2D.width; j++) {
if (tex2D.GetPixel (i, j) == Color.clear)
tex2D.SetPixel (i, j, whatToFillWith);
}
}
return tex2D;
}
private void GetLatestDeviceOrientation() {
myDeviceOrientation = Input.deviceOrientation;
}
public void Update(){
float z = -90;
GetLatestDeviceOrientation ();
// Check if you are facing rare camera
if (currentCamIndex == 0) {
// rare camera is activated
//filePath.text = "Rear camera is activate";
switch (myDeviceOrientation) {
case DeviceOrientation.Portrait:
// filePath.text = " P Rear camera is activate ";
z = -90;
quatRotation.eulerAngles = new Vector3 (0, 0, z);
break;
case DeviceOrientation.LandscapeLeft:
// filePath.text = " L L Rear camera is activate ";
z = 0;
quatRotation.eulerAngles = new Vector3 (0, 0, z);
break;
case DeviceOrientation.LandscapeRight:
//filePath.text = " L R Rear camera is activate ";
break;
}
} else if (currentCamIndex == 1) {
// front camera is activated
//filePath.text = "Front camera is activated";
} else {
// not sure which camera
//filePath.text = "Not sure which camera";
}
//quatRotation.eulerAngles = new Vector3 (0, 0, z);
}
private void SetDebugText(string debugMessage){
if (debug != null) {
debug.text = debugMessage;
}
}
}
Could I integrate the code from the post link above or is there a simple way to make the image show right side up on the camera display and save the same so the post is also right?
Thanks,
GregandroidioswebcamtexturewebcamSun, 13 Aug 2017 08:44:30 GMTgregacunaGame lightning issue in low-end android devicehttp://answers.unity3d.com/questions/1392973/game-lightning-issue-in-low-end-android-device.html
When I test my game on a low-end android device the lightning has certain distance like a weird fog, is there a way to increase this "lightning render distance"? I heard it had something to do with lightning path but i'm not sure. Here is a screenshot:
![alt text][1]
[1]: /storage/temp/99765-capturaaaa.pngandroidlightingrenderingissueSat, 12 Aug 2017 22:44:08 GMTTioTresPelosCustom Event not showing up on the validatorhttp://answers.unity3d.com/questions/1392950/custom-event-not-showing-up-on-the-validator.html
Hello, I have had a beta game released since 7/21. I enabled analytics at this time just to see DAU, MAU... stuff like that. Unity version is 2017.1.0f3.
https://play.google.com/store/apps/details?id=com.BeardedSynergy.GnomeRunner
I now want to add in some custom events to see a little more into the eyes of the player. Yesterday around 4:00 I added a method that builds a Custom event and send it on death. I then made a build "With Development Build" checked and ran it. I have still yet to see the data come on the data explorer in the dashboard.
I also went through the validator steps, and the custom never shows up. In the unity services analytics the validator shows data from 8/1 as the last data
`08/01/2017 03:12:28 appStop
Platform: WindowsEditor
SDK Version: u2017.1.0f3
08/01/2017 03:12:28 appRunning
Platform: WindowsEditor
SDK Version: u2017.1.0f3
08/01/2017 03:12:27 appRunning
Platform: WindowsEditor
SDK Version: u2017.1.0f3
08/01/2017 03:06:02 appStop
Platform: WindowsEditor
SDK Version: u2017.1.0f3
08/01/2017 03:06:02 appRunning
Platform: WindowsEditor
SDK Version: u2017.1.0f3
08/01/2017 03:06:01 appRunning
Platform: WindowsEditor
SDK Version: u2017.1.0f3
08/01/2017 02:49:45 appStop
Platform: WindowsEditor
SDK Version: u2017.1.0f3
08/01/2017 02:49:45 appRunning
Platform: WindowsEditor
SDK Version: u2017.1.0f3
08/01/2017 02:49:18 appRunning
Platform: WindowsEditor
SDK Version: u2017.1.0f3
08/01/2017 02:47:45 appRunning`
Im calling this method when the player dies
`public void SendDeathInfoEvent()
{
Analytics.CustomEvent(deathData, new Dictionary<string, object>
{
{playerScore, GetPref(_playerScore,Prefs.scorePref) },
{deathPosition, playerController.transform.position },
{spendingCoins,GetPref(_spendingCoins,Prefs.scoreSpeedPref) }
});
Debug.Log(Analytics.CustomEvent(deathData, new Dictionary<string, object>
{
{playerScore, GetPref(_playerScore,Prefs.scorePref) },
{deathPosition, playerController.transform.position },
{spendingCoins,GetPref(_spendingCoins,Prefs.scoreSpeedPref) }
}));
}`
The debug log show OK so i know it is building the event but it is never posting it. The link is established so it should be working. Any ideas?c#androideventSat, 12 Aug 2017 20:49:43 GMTmelsyUnity5 Android Exporting - Different behaviours on different deviceshttp://answers.unity3d.com/questions/1392780/unity5-android-exporting-different-behaviours-on-d.html
I have some issues on exporting .apk file from Unity5.
I can build apks succesfully, but on runtime something goes different depends on devices i'm using. Here's the thing:
I have Sqlite database called "guess.bytes". On Samsung devices(Android 6.0.1 and Android 4.1), it works perfectly. But on Lenovo K6 Note device(Android 6.0.1) cant find the database path(I think) 'cause i'm getting "Database is not open" error.
I'm using StreamingAssets folder to keep database. And here's my code:
public void connection()
{
try
{
if (Application.platform != RuntimePlatform.Android)
{
path = Application.dataPath + "/guess.bytes";
}
else
{
path = Application.persistentDataPath + "/guess.bytes";
if (!File.Exists(path))
{
WWW load = new WWW("jar:file://" + Application.dataPath + "!/assets/" + "guess.bytes");
while (!load.isDone) { }
File.WriteAllBytes(path, load.bytes);
}
}
db_con = new SqliteConnection("URI=file:" + path);
db_con.Open();
if (db_con.State == ConnectionState.Open)
{
txtRes.text = path.ToString() + " - Connected";
}
}
catch (Exception ex)
{
txtRes.text = ex.Message;
}
}androidsqliteSat, 12 Aug 2017 11:14:30 GMTburaakya2017.2 Proguard Minify Android Buildshttp://answers.unity3d.com/questions/1392556/20172-proguard-minify-android-builds.html
Looking at the documentations for 2017.2, it looks like pro guard minification is being added for android builds. I downloaded the beta to check it out, but the box is greyed out in player settings. Do we know for sure that this is going to make it into 2017.2 for sure? Is this a pro feature? Is there any documentation on this somewhere? (other than just an enum in script docs )androidFri, 11 Aug 2017 19:04:17 GMTsnakeylakeBuilding game for android - ERROR!http://answers.unity3d.com/questions/1392534/building-game-for-android-error.html
I have only one error saying: Error building Player because scripts have compile errors in the editor.
I have many GOOGLE VR scripts in the project and only 2 scripts written by me.
Can anybody help me, please?androiderrorbuildandroid buildFri, 11 Aug 2017 17:54:56 GMTarabadzievApplication.Quit() won't work on Androidhttp://answers.unity3d.com/questions/1392498/applicationquit-wont-work-on-android.html
Hi there,
I am trying to make the application quit itself when you press the back/return key of a Android phone.
I tried putting this code in the update of a script attached to a gameObject that is present in all my scenes, because of DontDestroyOnLoad:
if (Input.GetKeyDown(KeyCode.Escape)) { Application.Quit(); }
I just tested something to see if I get inside the if, when playing on my phone. And I get there. Application.Quit() is the issue here. I hope someone can help me and explain how I can quit the app in Android.
Thanks! :)androidFri, 11 Aug 2017 16:42:13 GMTrickyfreddyRevMob Script Unityhttp://answers.unity3d.com/questions/1392393/revmob-script-unity.html
Hi, am a programmer at the beggining of my road.
I don't have skills in programming at the moment.
I want to integrate RevMob in my Unity Android Game.
I downloaded the SDK , started a new Unity project and made a empty GameObject.
Can you help me with the script?
I just want to show interstitial ads
Can you make me the script, please?
Thank you in advanceandroidunity5script.adsrevmobFri, 11 Aug 2017 11:57:23 GMTtraiannn