How to call javascript functions from functions defined within .jslib plugins?
This seems pretty straightforward but thus far I haven't found any info regarding this issue. Say I have the following code: mergeInto(LibraryManager.library, { Example: function (){ // Do some things...
View ArticleI want to put main camera floating
I want to put main camera floating ,on water (surface water) , so (main camera) not passed throuth water . please help thanks
View ArticleScaling Unity WebGL Canvas causes a bad performance
Hello. I'm scaling WebGL canvas according to the size of the browser window as below. This works well as I want, but the game performance becomes quite bad when the canvas is big, especially when...
View ArticleCheck if WebGl Instance has fully loaded
We are making a WebGL Game for Christmas. Once a user has logged in over our website, the unityInstance is loaded. We'd like to send the id of the logged in user to our Game and tried using the...
View ArticleRamp Hp function by speed
Hello. I call this function to roll the hp down when the character is hit with damage, or ramp it up when given food or a potion, instead of just saying hp -= x; function HpRoller(amt : float, roll :...
View Articlejava.lang.ClassNotFoundException: com.google.android.gms.games.Games
I tried implementing Google Services in my game, I've done every setup including the SHA 1 key but am getting this error from logcat each time i try signing in: 01-30 13:35:31.852 30868 30886 I Unity :...
View ArticleOpen in link in lightbox/colorbox from webgl
Hi, We manage to open a link in a new tab from unity through the use of jslib: var OpenWindowPlugin = { openWindow: function(link) { var url = Pointer_stringify(link); document.onmouseup = function() {...
View ArticleGetting Unity WebGL to receive data from a script in a browser extension
Hi all-- I'm attempting to implement a feature whereby my Unity webGL app can print out the URLs of all the open tabs in the user's browser. I've managed to write a chrome extension that uses a...
View Article"A JavaScript error occurred in the main process" after installing Unity Hub
I received this error after installing Unity Hub for the first time. Have tried reinstalling, rebooting, running as administrator, looking at the permissions, searching the Internet for answers and...
View ArticleJSLib - Get a reference to the player
Hi! I am developing Assets with WebGL support which utilize the jslib feature. To send data to the C# counterparts of the asset, I need to use "sendMessage" on the unity player reference. Is there any...
View ArticleWebView javascript function call from Unity c# script (no use webgl )
Hello :) I trying to create Webview( web browser ) in unity. Build way is standalone( window, mac, Linux). I don't want to use Webgl and web Player or other things only standalone. I want to web...
View ArticleUnity WebGL UnityInstance.SendMessage Error: SendMessage: object Object1 does...
I have a built WebGL Unity game using Unity 2020.3.8f1 and I have modified the script on the index.html template to look like this: I only changed one line: **unityInstance.SendMessage("Object1",...
View ArticleUnity WebGL UnityInstance.SendMessage Error: SendMessage: object Object1 does...
I have a built WebGL Unity game using Unity 2020.3.8f1 and I have modified the script on the index.html template to look like this: I only changed one line: **unityInstance.SendMessage("Object1",...
View Articleimplementing android activity?
![alt text][1] [1]: /storage/temp/182103-capture.png hello, how can i implement these android codes in unity c#? [Unity 2021.1.x] thanks a lot.
View ArticleWhy does WASD move my player quicker than with a joystick?
For some reason, if you use a keyboard to move my player it's faster than a joystick. Can anyone help me? Here's my code: #pragma strict var moveSpeed : float; var clampRadius : float; var dashSpeed :...
View ArticleWhy am I only allowed to trigger my dash script once?
I have a player movement controller script and a dash script. The movement controller turns on the dash script whenever space is pressed but for some reason it only works once. It won't let me do it a...
View ArticleHow do I unpause my game using Time.timeScale?
I'm trying to write a pause script and I can't figure out how to unpause properly. Can anybody help? Here's what I have but it's not working: #pragma strict var gamePaused : boolean = false; function...
View ArticleHow would I go about keeping my player object moving after a scene change?
I have a scene change in my prototype but every time the second scene is loaded, the player stops moving and you have to repress whichever direction you were holding, How would I keep the player moving...
View ArticleIs jslib in Assetstore package allowed?
Hi! I'm preparing to submit an asset store package, which requires an .jslib plugin to work when building for webgl. When using the Asset Store Tools' Validator I get the warning "Remove JavaScript". I...
View ArticleJavascript communication 2 ways. Simple examples / tutorials?
I am not a skilled programmer. I know how to code in Unity (the basics). I have searched youtube and came a cross a lot of tutorials which are outdated. They don't work anymore on the Unity 2020+...
View Article