I'm making a Facebook Instant Game and when played on Windows browser, the games look good. But when played on mobile messenger, the game just became really blurry and low resolution. Even the startup Unity logo and "Made with Unity" screen is blurry. I checked other messenger games and they look good.
Is there any solution to make my game look good on messenger mobile?
Thanks.
↧
My Facebook Instant game looks low resolution and blurry
↧
A texture fades out to become the color of the skybox, and lags when instansiating.
Unity is great, and I made an ok game with it. In the editor, everything runs fine, the texture stays **consistent**, but when I export it to WebGL, on chrome, the texture fades out. Is it just a chrome problem? I tried on safari and edge, and it worked. My other problem **(same game)** when you get to 10000, I instansiate an object that has a z of 10000. How do I stop this from lagging the whole game. It kind of makes the game unplayable. But this time, it lags in the editor too. I'm pretty sure it's not a code, problem, but if you need code, just ask. Otherwise, here is the webgl build. Sometimes, for other computers it works. One small last one, if you die, sometimes the game returns some asm.js and framework errors. Only on some computers, sometimes. It seems to happen when Invoking. It will probably not happen to you, but I just want to know what to do if it happens again. If it does work for you, why do the panels become so large? In the gameover screen, the panel, which again looks fine in one size, and I'm not resizing it, it still makes it large. Thank you for your time, and sorry if I put too much in one question.
[My game][1]
[1]: http://infinitecarspeeder.netlify.com
↧
↧
The script from “.../TemplateData/UnityProgress.js” was loaded even though its MIME type (“”) is not a valid JavaScript MIME type
I get this warning in Firefox when i build my webGL project. I opened a test project and did not get the issue. I compared my the .JS files from the two outputs and they are identical as far as i can see.
It may be harmless but I have a much bigger issue that i am trying to get to the bottom of and want to eliminate this as a possible culprit. Plus i am curious.
↧
WebGL and Splitscreen (mutliple cameras)
I currently need to provide splitscreen functionality in one of our apps, it works perfectly fine on desktop, but not on WebGL. It seems to just not even bother displaying the second camera.
There was a question on this at the end of last year: https://answers.unity.com/questions/1577204/unity-webgl-show-only-one-camera-when-use-multiple.html
I was wondering if this is being tracked at all and if there is an update that could be provided on it's status?
Thanks.
↧
Unity WebGL Build: Why it shows only Empty Folder?
i'm trying to built my game, made in Unity 2018.3, and i'm trying to built it in WebGL, but the problem is this: built was succeeded, but the Folder is still Empty, and here is the problem occured. ![hope you can read it][1]
[1]: https://i.stack.imgur.com/RkSU2.png
This never happens to me, everytime i build with WebGL. anybody know how to fix it?
↧
↧
WebGL on mobile
Hey guys, i want to create a WebGL package which should be displayed in an application on mobile. I tried it with the build option in Unity (WebGL) but when i try to embedd the package in my mobile application and then start it, i'll get the message "WebGL is not supported on mobile". Are there any properties in the build settings i need to turn on?
Thank you for your help.
↧
Use javascript library (like from npm) in unity WebGL?
Hey there,
I want to use the signalr JavaScript library (https://www.npmjs.com/package/@aspnet/signalr) in Unity WebGL. Multithreading is not supported in Unity so I can't use the C# version.
Is it even possible to use an extern javascript library?
I know that I can create small .jslib files with some basic javascript code. But is it possible to use an entire extern library? I have'nt seen it before and can't find any references.
Greets
↧
Can't build on WebGL
Hi,
I can't build my project on WebGL and all my other colleagues sharing the project in GitLab can.
I've searched all over the internet for several days but I can't find a proper solution. [None of these solutions works for me.][1]
When I launch the build I've got the following message at the very end of the build:
Failed running "C:\Program Files\Unity\Hub\Editor\2018.3.6f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\python.exe" "C:\Program Files\Unity\Hub\Editor\2018.3.6f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emcc" @"D:\GitHub\7Angels\Assets\..\Temp\emcc_arguments.resp"
stdout:
stderr:Traceback (most recent call last): File "C:\Program Files\Unity\Hub\Editor\2018.3.6f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emcc", line 11, in python_selector.run(__file__) File "C:\Program Files\Unity\Hub\Editor\2018.3.6f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\python_selector.py", line 38, in run sys.exit(run_by_import(filename, main) if on_allowed_version() else run_by_subprocess(filename)) File "C:\Program Files\Unity\Hub\Editor\2018.3.6f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\python_selector.py", line 13, in run_by_import return getattr(importlib.import_module(os.path.basename(filename)), main)() File "C:\Program Files\Unity\Hub\Editor\2018.3.6f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emcc.py", line 1902, in run wasm_text_target, misc_temp_files, optimizer) File "C:\Program Files\Unity\Hub\Editor\2018.3.6f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emcc.py", line 2373, in do_binaryen subprocess.check_call(cmd) File "C:\Program Files\Unity\Hub\Editor\2018.3.6f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\lib\subprocess.py", line 542, in check_call raise CalledProcessError(retcode, cmd)subprocess.CalledProcessError: Command '['C:\\Program Files\\Unity\\Hub\\Editor\\2018.3.6f1\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\Emscripten_FastComp_Win\\binaryen\\bin\\asm2wasm', 'D:\\GitHub\\7Angels\\Temp\\StagingArea\\Data\\linkresult_wasm\\build.temp.asm.js', '--total-memory=1073741824', '--trap-mode=clamp', '-O3', '--mem-init=D:\\GitHub\\7Angels\\Temp\\StagingArea\\Data\\linkresult_wasm\\build.js.mem', '--mem-base=1024', '--wasm-only', '--symbolmap=D:\\GitHub\\7Angels\\Temp\\StagingArea\\Data\\linkresult_wasm\\build.js.symbols', '-o', 'D:\\GitHub\\7Angels\\Temp\\StagingArea\\Data\\linkresult_wasm\\build.wasm']' returned non-zero exit status -1073741819
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
[1]: https://answers.unity.com/questions/1381337/export-to-webgl-failed.html
↧
WebGL App doesn't work correctly in Safari?
Hi
I have a small WebGL application which works fine in Chrome and Firefox but doesn't in Safari. First it only showed the content only in black and white in Safari, which is not intended. And now all of a sudden with no significant changes on my part (I think) the WebGL container is completely black with UI still showing normally. It shows the loading screen normally but as soon as it is loaded the screen goes black.
-
Anyone who might have an idea what could be the reason for something like that? Chrome and Firefox still works normally.
Thanks in advance
↧
↧
Is it possible to change WebGL game resolution inside the canvas ?
Hello !
It seems that in WebGL, the game will use the browser window resolution as its own resolution which make our product lag as hell on a bigger screen.
To counter that, I would like to add a maximum limit resolution (let's say 1080p) and use that resolution if the canvas is bigger than that.
I tried to use Screen.SetResolution but it's not working, SetResolution does not seems to do anything in WebGL.
I also tried to resize the canvas with some javascript directly in the index.html. It works but the game does not uses the full window.
Is it possible to change the game resolution, inside the canvas, without changing the canvas size ?
Thanks.
↧
MongoDb in Unity WebGL
Hello people.
I'm trying to access a Mongodb in a WebGL project.
Here is an excerpt from my DbConnector:
using System;
using MongoDB.Driver;
using UnityEngine;
public class DbConnector : MonoBehaviour
{
private static MongoClientSettings _settings = new MongoClientSettings
{
Server = new MongoServerAddress("localhost", 27017),
};
private static MongoClient _client = new MongoClient(_settings);
private static IMongoDatabase _userDatabase;
public static IMongoDatabase GetDatabase(string dbName)
{
switch (dbName)
{
case "user":
if (_userDatabase != null)
return _userDatabase;
break;
}
return null;
}
private void Start()
{
try
{
_userDatabase = _client.GetDatabase("user");
Debug.Log("Loading userdb complete!");
}
catch (Exception e)
{
Debug.Log("can't load user db from server: " + e);
}
}
}
In the editor this works fine, even if the Mongodb is on a server and has authentication.
As soon as I upload it, however, I get this error:
MethodAccessException: Attempt to access method 'MongoDB.Driver.IMongoDatabase.GetCollection' on type '' failed.
The script 'DbConnector' could not be instantiated!
(Filename: ./Runtime/Scripting/ManagedReference/SerializableManagedRef.cpp Line: 225)
_JS_Log_Dump @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
wasm-function[4077] @ wasm-0000006e-4077:22
wasm-function[4090] @ wasm-0000006e-4090:22
wasm-function[4084] @ wasm-0000006e-4084:826
wasm-function[4071] @ wasm-0000006e-4071:518
wasm-function[4626] @ wasm-0000006e-4626:326
wasm-function[4619] @ wasm-0000006e-4619:824
wasm-function[4578] @ wasm-0000006e-4578:192
wasm-function[4664] @ wasm-0000006e-4664:310
wasm-function[6683] @ wasm-0000006e-6683:15
wasm-function[6833] @ wasm-0000006e-6833:97
wasm-function[6832] @ wasm-0000006e-6832:133
wasm-function[6831] @ wasm-0000006e-6831:20
wasm-function[6817] @ wasm-0000006e-6817:4
wasm-function[4579] @ wasm-0000006e-4579:474
wasm-function[4575] @ wasm-0000006e-4575:188
wasm-function[8643] @ wasm-0000006e-8643:416
wasm-function[8573] @ wasm-0000006e-8573:914
wasm-function[9847] @ wasm-0000006e-9847:397
wasm-function[9846] @ wasm-0000006e-9846:25
wasm-function[9844] @ wasm-0000006e-9844:40
wasm-function[9840] @ wasm-0000006e-9840:280
wasm-function[9835] @ wasm-0000006e-9835:157
wasm-function[9704] @ wasm-0000006e-9704:532
wasm-function[9703] @ wasm-0000006e-9703:5
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
callMain @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
doRun @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
run @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
runCaller @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
removeRunDependency @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
doCallback @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
done @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
done @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
storeLocalEntry @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
IndexedDB (async)
loadRemoteEntry @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
reconcile @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
IndexedDB (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
success (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
IndexedDB (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
success (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
IndexedDB (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
success (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
IndexedDB (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
success (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
IndexedDB (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
IndexedDB (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
success (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
IndexedDB (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
success (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
IndexedDB (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
success (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
IndexedDB (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
success (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
IndexedDB (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
IndexedDB (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
IndexedDB (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
IndexedDB (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
IndexedDB (async)
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
IndexedDB (async)
getDB @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
getRemoteSet @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
getLocalSet @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
syncfs @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
syncfs @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
callRuntimeCallbacks @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
preRun @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
run @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
runCaller @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
removeRunDependency @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
receiveInstance @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
receiveInstantiatedSource @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
Promise.then (async)
doNativeWasm @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
(anonymous) @ blob:http://wcontrib…8e6d-f5ecdf83dedb:8
UnityLoader.loadCode.Module @ 3998187….js:4
i.onload @ 3998187….js:4
load (async)
loadCode @ 3998187….js:4
processWasmFrameworkJob @ 3998187….js:4
i.callback @ 3998187….js:3
setTimeout (async)
i.complete @ 3998187….js:3
(anonymous) @ 3998187….js:4
r.worker.onmessage @ 3998187….js:3
The app itself goes. Only not the connection to the Mongodb.
The dlls I have among other things from:
https://github.com/mongodb/mongo-csharp-driver
or from:
https://github.com/mongodb/mongo
or here:
https://github.com/Julian23517/Unity-mongo-csharp-driver-dlls
The latter from the post (at the bottom) by:
https://answers.unity.com/questions/618708/unity-and-mongodb-saas.html
Nothing has come up with a solution yet.
Here are my ProjectSettings:
![alt text][1]
and here:
![alt text][2]
[1]: https://forum.unity-community.de/uploads/monthly_2019_07/image.png.e2eae63458d7ae66828928123cefe711.png
[2]: https://forum.unity-community.de/uploads/monthly_2019_07/image.png.02f0c93bc9aeb2301a2377ecb77aea78.png
↧
Unity WebGL mouse and touch input
Hello,
----------
I am currently developing a web application for Windows.
The problem is that the application should runs asweel on touchscreen windows (only with touch interactions) and "classic" windows (with mouse and keyboard).
----------
So I have severals question ?
----------
- Is WebGL possible on touchscreen windows ?
- Can the application uses all the fonctionnalities of the Touch Input (multi fingers touch for example) with WebGL ?
- Is there a way to know if the application runs on touchscreen or a computer with mouse ?
----------
Thank you !
↧
can't export to webgl
I am getting the errors:
DirectoryNotFoundException: Could not find a part of the path"C:\Users\Public\Documents\Wondershare\CreatorTemp\tmp526f1052.tmp".
what does it mean please help
↧
↧
Using CachedXMLHttpRequest
Hello,
I looked at the asset from Unity https://www.assetstore.unity3d.com/en/#!/content/71538 and tried implementing it. There is pretty much 0 documentation and the only semi detailed explanations were 3rd party blogs like https://blog.kongregate.com/unity-webgl-memory-optimization-part-deux/.
This package is suppose to store your asset bundles out of memory so that they do not take up memory during runtime. If you have 5 bundles, they will all be constantly in memory even if you are not using them.
I tried implementing this package but my IDBFS database is still full and still in memory. Is there any C# modifications i need to make to use this package? How do i implement besides add the package to my project?
Thanks
Mitch
↧
WebGL Build Error:UnusedBytecodeStripper2.exe --api NET_2_0 -out
**Build Android and PC,and Empty project(WebGL) is ok.
but on my Project build WebGL have error,
maybe is GoogleAD caused?or facebook sdk?
someone Can help me understand the error or fix?
Unity version is 5.6.7f1
I'm try to set Api Compatibility Level .Net2..0
**
Failed running C:\Program Files\Unity\Editor\Data\Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe --api NET_2_0 -out "F:\ProjectTest\SetUnityForSDK\Temp\StagingArea\Data\Managed\tempStrip" -l none -c link -b true -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\Whitelists\Core.xml" -f "C:\Program Files\Unity\Editor\Data\il2cpp\LinkerDescriptors" -x "F:\ProjectTest\SetUnityForSDK/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml" -x "F:\ProjectTest\SetUnityForSDK\Temp\StagingArea\Data\preserved_derived_types.xml" -x "F:\ProjectTest\SetUnityForSDK\Assets\FacebookSDK\link.xml" -d "F:\ProjectTest\SetUnityForSDK\Temp\StagingArea\Data\Managed" -a "F:\ProjectTest\SetUnityForSDK\Temp\StagingArea\Data\Managed\Assembly-CSharp-firstpass.dll" -a "F:\ProjectTest\SetUnityForSDK\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll" -a "F:\ProjectTest\SetUnityForSDK\Temp\StagingArea\Data\Managed\UnityEngine.Analytics.dll" -a "F:\ProjectTest\SetUnityForSDK\Temp\StagingArea\Data\Managed\Facebook.Unity.Settings.dll"
stdout:
SweepReport:
Mono.Cecil.MethodDefinition (12391) => System.Void .ctor(System.String,System.Object[]), System.Void Call(System.String,System.Object[]), FieldType Get(System.String), System.Void Set(System.String,FieldType), FieldType GetStatic(System.String), ...
Mono.Cecil.TypeDefinition (3101) => UnityEngine.WeakListenerBindings, UnityEngine.NetworkReachability, UnityEngine.UserAuthorization, UnityEngine.ApplicationInstallMode, UnityEngine.ApplicationSandboxType, ...
Mono.Cecil.FieldDefinition (987) => AdvertisingIdentifierCallback OnAdvertisingIdentifierCallback, UnityEngine.Application/LogCallback modreq(System.Runtime.CompilerServices.IsVolatile) s_RegisterLogCallbackDeprecated, System.String unsupportedIdentifier, System.Byte kIsVisibleMask, System.Byte kDistanceMask, ...
Fatal error in Mono CIL Linker
Mono.Cecil.ResolutionException: Failed to resolve UnityEngine.ImageConversion�� UnusedBytecodeStripper2.AddUnresolvedStubsStep.Process()
�� Mono.Linker.Steps.BaseStep.Process(LinkContext context)
�� Mono.Linker.Pipeline.Process(LinkContext context)
�� Mono.Linker.Driver.RunDriver(Driver driver, IEqualityComparer`1 typeComparer, IEqualityComparer`1 methodComparer)
stderr:
UnityEngine.Debug:LogError(Object)
UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:96)
UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable`1, String&, String&, String, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:102)
UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String[], String[], String, String, String&, String&, String, IIl2CppPlatformProvider, IEnumerable`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:95)
UnityEditorInternal.AssemblyStripper:RunAssemblyStripper(String, IEnumerable, String, String[], String[], String, IIl2CppPlatformProvider, RuntimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:201)
UnityEditorInternal.AssemblyStripper:StripAssemblies(String, IIl2CppPlatformProvider, RuntimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:126)
UnityEditorInternal.IL2CPPBuilder:Run() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:143)
UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry, Boolean) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:41)
UnityEditor.HostView:OnGUI()
↧
Base64 to texture decoding, js -> webgl
I'm building webgl application in unity and I want to allow user to import image (png).
Javascript: function process(input) { let file = input.files[0]; let reader = new FileReader(); reader.onload = function (e) { unityInstance.SendMessage('Phone', 'SetImageFromBase64', e.target.result); }; reader.readAsDataURL(file); } C#: private void Awake() { SetImageFromBase64(); } public void SetImageFromBase64(string str = "data:image/png;base64,iVBORw0KGg(...)") { var bytes = Convert.FromBase64String(str.Substring("data:image/png;base64,".Length)); var tex = new Texture2D(2, 2); tex.LoadImage(bytes); tex.wrapMode = TextureWrapMode.Clamp; tex.Apply(); meshRenderer.material.SetTexture(MainTex, tex); } And when application is started, image is properly loaded, but when I try to load same image using javascript all I'm getting is black texture. Do anyone have an idea why this is happening?
Javascript: function process(input) { let file = input.files[0]; let reader = new FileReader(); reader.onload = function (e) { unityInstance.SendMessage('Phone', 'SetImageFromBase64', e.target.result); }; reader.readAsDataURL(file); } C#: private void Awake() { SetImageFromBase64(); } public void SetImageFromBase64(string str = "data:image/png;base64,iVBORw0KGg(...)") { var bytes = Convert.FromBase64String(str.Substring("data:image/png;base64,".Length)); var tex = new Texture2D(2, 2); tex.LoadImage(bytes); tex.wrapMode = TextureWrapMode.Clamp; tex.Apply(); meshRenderer.material.SetTexture(MainTex, tex); } And when application is started, image is properly loaded, but when I try to load same image using javascript all I'm getting is black texture. Do anyone have an idea why this is happening?
↧
Text Disappears on WEBGL Build
I need help with a webGL build of my game - I have a video playing in the background via streaming assets and URL, which may be the cause of the text disappearing. See the images below:
(How it should look like)
![alt text][1]
(What it looks like on the WebGL build, running on localhost)
![alt text][2]
Any help would be great!
[1]: /storage/temp/143296-howitshouldlooklike.png
[2]: /storage/temp/143297-whatitlookslike.png
↧
↧
Should Cloud Diagnostics work on a Unity 5.6 webGL build?
Currently using Unity 5.6.6f2
Enabling Cloud Diagnostics on Services Panel, seems to work well when running the scene on Play Mode in Unity Editor. Exceptions are logged correctly to Unity Dashboard.
However, when running the same scene from a webGL build hosted on a server, the Exceptions are not logged at all to the Dashboard.
I'm couldn't find any info on this. Was this supossed to work?
↧
How to pre-load large webgl
My webgl are often over 100MB which takes a lot of time to load on not so fast connections. Have you ever encountered this problem? What was you approach to the solution?
Is it possible in html to start pre-loading the Webgl while browsing other pages of my website, before you actually get to the page that has webgl in it?
Thank you very much
↧
WebGL IOS bug
When the game starts, instantly it restarts and always goes on, restarting and restarting, is something wrong with the construction?
Error happens only in browsers being used on IOS devices ... see:
http://pudimatomico.000webhostapp.com/lequedigital.com.br/buildTest/index.html
↧