Baked LightMap Doesn't Loads after Downloading Asset Bundles on Mobile devices - unity3d

I have a Scene which has many models. I Baked that scene and got some lightmaps. I put those lightmaps and those models inside one bundle category and that scene in another as I can't add both models and scene inside one bundle category. I can download those models and scene properly and loads the scene. Everything works perfectly but lightmaps don't get load. It loads in Editor but it doesn't work in mobile devices(IOS/Android). I tried logging LightmapSettings.lightmaps.Length also and it gives proper output in mobile. But those maps won't load. Anyone knows whats the problem?

Not sure if this is the problem but try it.
Go to Files->Settings-> Select Android Switch click Switch Platform.
Rebuild your Asset. Name it AndroidAsset.
Go to Files->Settings-> Select iOS Switch click Switch Platform.
Rebuild your Asset. Name it iOSAsset.
When building the for each platform,load each Asset with the platform Asset it was built for.

Related

Canvas displayed in gameView but not in build

I was testing the build settings for my project that got a Main UI canvas which is displaying some objects, and when the mouse is on the current object, a copy of it is instantiated in an above canvas (well in the editor it's under the other canvases, so in real view it's above all), with a layer above all other like this:
zoomCard = Instantiate(gameObject, new Vector2(980, 750), Quaternion.identity);
zoomCard.transform.SetParent(ZCanvas.transform, false);
zoomCard.layer = LayerMask.NameToLayer("Zoom");
//adds a zoom
RectTransform rect = zoomCard.GetComponent<RectTransform>();
rect.sizeDelta = new Vector2(260, 399);
So in game View everything works fine.
But as soon as I build it in html5, the zoomed card never shows. I tried with safari, Chrome, and Firefox, same thing.
So I tried to build it in Mac executable too : same thing.
How can I possibly debug this? As on my game view render I have no problem.
So I've found in other posts that, when unity crashes or when you update your project into a new version (my case).
Unity does not import some shaders for some given classes with no reason.
The workaround that worked for me was this one:
Browse to the folder/directory of your project.
Delete the Project Settings Folder.
You'll need to re import the scenes in your build, and evertything will work as it should

SceneManager.LoadScene/LoadSceneAsync loads empty scene (WebGL) Unity 5.6

After update 5.6.1f my WebGL build can't load scene correctly.
Develop build and DebugSumbols activated - same result. No errors, no warnings.
Always was load empty scene, but with NotDestroyOnLoad objects after prevois scene.
Same problem, but no answer.
https://forum.unity3d.com/threads/black-screen-when-changing-scene-in-webgl-using-unity-5-6.473367/
When creating the build for Android we used the option "Split Application Binary" at the Player settings. Of course this setting is stored in the project. It just happens to be the setting that makes scene switching in WebGL impossible! After some hard work in stripping down our project it occurs that this is the only setting that causes the bug. I really don't know why an Android setting ends up having a major impact on a WebGL build. Something Unity should investigate!
(using Unity 5.6.1f1)
https://forum.unity3d.com/threads/black-screen-when-changing-scene-in-webgl-using-unity-5-6.473367/

Marker not working properly in ARtoolkit in Unity

I am working on a simple AR project using Unity and ARToolkit. For testing purposes, I have created a test project to track the image and create a simple 3d sphere and it is working perfectly when I play it from inside the Unity editor. The problem is that when I create the build .exe of the project, the application does not augment the 3D model of the marker when I put the marker in front of Camera (it should work as it is working when playing from inside the editor). It is also showing two errors as I build the project. Note that I have included the .dll files in the folder where .exe file is located.
Also I see that after building the project, the UID of the marker disappears as well as it is showing perfectly when played from inside the Unity Editor.
Kindly guide me in this matter as I have to submit this project to the university final year project. ThankYou
several things on this:
the disappearing of the marker ID during the build of the APP is normal and does not affect your result
Please check if you have selected the correct scene when building your APP:
Build view
select the "Add open scenes" button and tick the scene(s) you would like to include in your APP.
(It happens quite often that the wrong scene is picked)
Also ensure that you are copying the correct versions of the dlls (32bit vs. 64bit) but if you copied the ones from the [appname]_data/Plugins directory you should be fine.
Let me know if that works for you.

How do I create an AR marker for Vuforia / Unity?

This is a horribly basic question I know (!) but how do I create and import an AR marker into Unity? I know I am meant to do it through the Vuforia Marker Manager page. I have created a Target Database and I have downloaded the database, but how do I get the marker to display in Unity?
Also: what exactly is a Target Database? Is that another name for 'marker'?
To answer your question specifically, yes your Marker is your Target.
So what you need to do is:
Go to License Manager. Add a License Key choosing None as your License plan.
Now go to Target Manager. Create a Database and add the license for it from the drop down.
Add Target, and select from your computer the Image that you want to be the Marker, and upload it.
Once the status of the Target changes to active you can click Download Database and make sure you click For UnityEditor. This downloads a .unitypackage
Now inside Unity, go to Assets>Import New Assets... and locate to the .unitypackage you downloaded
This is how you import your database.
If you haven't Imported the Vuforia package Unity Extension then you
simply need to download it from the Downloads section and Import it
through the Assets>Import Package> Custom Package
Now ideally to work with AR, you would use the AR Camera, which is located in your Assets Bar in Qualcomm Augmented Reality>Prefabs. Drag ARCamera onto your scene.
With the AR Camera selected in the Hierarchy look at the Inspector tab. You'll see Data Set Load Behavior. Under that you SHOULD see the name of the .unitypakage you imported ealier. Check the name as well as make it Active.
Now in Qualcomm Augmented Reality>Prefabs you should also see Image Target. Drag that onto the screen as well.
With the ImageTarget selected in Hierarchy look at the Inspectorthere should be Image Target Behaviour
Fill in as follows
Type: Predefined
Data Set: <Name of imported .unitypackage>
Image Target: <Name of Picture uploaded into the Database>
Now you may work around the Image Target as per your app requirement.
NOTE: In the License Manager, click on the Name of the License and
you'll see a Alpha-numeric code. Copy that code, and within the
Inspector of the AR Camera, under QCAR Behaviour>App License Key
paste the code in. This must be done in order for your app to work on your > device.
Hope this helps you. Please feel free to ask me if anything.
There are a couple things that you need to do before getting this to work.
Firstly, I noticed you mentioned creating a Target Database on the Vuforia website, but have you actually added any markers to it? Markers are the actual AR images that will be scanned. A Target Database is a collection of markers that can be used simultaneously in your Unity application.
Once you have your markers uploaded they should have a 2-4 star rating as shown in the picture
After downloading the database as a UnityPackage you have to import it into Unity along with the Vuforia Unity SDK.
If you are still having trouble getting an example scene running within Unity you can download a sample scene at the previous link.

"OnMouseDown" not firing after converting resources to download bundle

I'm facing a strange issue, in my game i'm using OnMouseDown for click and drag etc everything working fine but once converting resources to download bundle (for downloading) it's not working any more and the rest of the script is working fine means Update etc functions are working.
note:Script is attached with the prefab which later on Instantiated in game to create objects.
using Bundle Assets From Selection - Track Dependency
Restart the unity3d and up,down and drag are working now. :)