#📱┃mobile
1 messages · Page 25 of 1
Hey guys. I'm trying to check players device OpenGL version, but unsuccessful. How do I know when my game is running on OpenGL 2.0? Thanks for now.
@dim sinew Thanks.
Hey you all,
Does anyone know why PlayOneShot is delayed/unreliable when playing sounds on Android? It's just fine in the editor, and on computer builds, but when running it on my Android, each time PlayOneShot is called, it either delays the sound effect, or skips it altogether.
It might be your compression settings. I haven't experienced that myself
I've tried all three formats (PCM, Vorbis, and the third one), yet none of them seemed to change anything. I also tried choosing to optimize sample rate, and that didn't change anything either.
Are you using decompress on load, streaming or compressed in memory?
And do you have preload audio data enabled?
These are my current settings, which I have played around with a bit:
I believe I've tried Force To Mono on/off, and tried the 3 Compression Formats, as well as Optimize / Preserve Sample Rate.
The file is a small sound effect with a duration of less than a second. It plays any time the user touches an onscreen button.
What do your audio source settings look like
in the inspector
And have you tried using Play() to make sure it's a problem with PlayOneShot?
I haven't tried using Play(). Since the sound effects are intended to play over each other, using Play won't give my game its intended functions.
These are my audio-source settings:
Are you using a single audio source** and hoping to play more than one sound on it at a time?
My audio listener is on my camera. I'm intending for that listener to hear all my sound effects.
If it matters, the audio source in my screencap above is on a UI object inside a canvas.
(I misread your question: Yes, I'm hoping to play multiple sound effects through this audio source simultaneously, based on player input.)
Ah, I see
and then you did too
but I edited mine lol
The only thing I can really think of is going through your project settings
The sounds delay / skip occurs when playing as few as 1 or 2 sounds from the audio source. The audio source plays sounds based on player input. If the player touches the image, it plays one sound. If the player releases their finger from the image, it plays a second sound.
have you checked the clip out in audacity and made sure there isn't any white noise at the beginning of the clips?
There's no white noise.
If I do this in my editor / computer build, then it works perfectly fine. However, on Android, the issue occurs.
I'm aware
I recently had a bunch of issues getting sound to work but with OpenGL and not android
If I could film the attempt on my phone, then I could show you in better detail. However, I unfortunately can't use my phone to film itself playing the game.
What a shame
Here are the functions involved:
If the player touches the button, then tryStartHover is called.
If the player releasees the button, then tryEndHover is called.
On Android, the start/end functions do everything they're supposed to - the color changes, the bool changes, and the coroutine is started. Except for one thing - they do not play the sound on time. And sometimes, the sound is omitted altogether.
where do these get called from? A button's On Click?
No event functions. They get called by my own home-made button manager.
Can you show me where they get called from?
I would try adding a second audiosource and/or using Play just to see if that makes any sort of difference
I'll try that.
In fact, how about this?
I'll remove the second sound effect. I'll only include one. See if that changes it.
No change.
The single sound effect is still delayed. You touch the button with your finger, and the "hoversound waits a second before playing.
But run in the editor, and it works as intended.
Using Play?
Oh, I'll try using Play() now.
I just noticed your Stereo Pan on your Audio Source is set to -0.8
is that intentional?
Yes, that's intentional.
Okay, I tried it with Play().
The sound is still delayed. It plays half a second after touching the button.
What are you using for an android?
Motorola G7 Power, 2019
These, right?
Try Best Latency and disabling Virtualize Effects
Alright, rebuilding.
I feel like it's now slightly (subjective) more responsive, but the delay is still like half a second.
What version of Unity are you on?
basically the last thing I can think of is to play around with these settings for your clips
Actually you should try using a native UI button and use OnClick() to call a brand new function that plays the same click
it's possible that what you're actually experiencing is a delay in your methods being executed
It's definitely not a delay in my method being executed.
All other lines in that function are executed - except for the audiosource line.
"bgColor.color = hoverColor" works.
"hovered = true" works
"StartCoroutine (grow ())" works
The function is, demonstrably, being called at the correct times, and only at the correct times.
The issue only seems to occur at the point where I call the audiosource to play my sound.
I can't use native UI buttons because they don't offer the flexibility I need.
I would attempt it just so you can definitively rule it out
Hm, alright. I'll post my results.
I have to go afk now, so I'll be back later.
Thank you for your patience and walking through the possibilities with me.
Also, have you tried setting the Stereo Pan and/or Doppler Level to 0
I'll try those when I'm back too.
Yeah sorry we couldn't get to the bottom of it D:
We certainly ruled out several things. 😛
Random question, could the fact that the audio source is on a child of a canvas be affecting it?
did you try changing doppler and pan?
@noble agate I believe the doppler effect changes the pitch of your sounds depending on the distance of your audio source from the listener
ideally they should be on the same game object
Unfortunately, defaulting doppler and pan didn't change anything.
I did a bit of reading up. Seems that audio latency on Android is common, and that one way to circumvent it is with an asset called Native Audio (which costs money).
whoever made that asset has posted that on every single thread talking about the problem
I wouldn't buy anything that's advertised in a shady way like that
did you attempt to use a unity UI button?
Hi, I just woke up. I'll give that a shot today.
trying to change a photo from an Android location into a texture for something I'm working on
but the readAllBytes seems to go wrong - I tested this by displaying a test text. and the last thing it shows me is "File Exists"
So therefore I know something must be going wrong with the ReadAllBytes function from Unity
Anyone got any idea? o-O
r u reading from Streaming Assets?
Would anyone be able to help me with apk build issues? Im making a game for android and it builds fine but the app crashes on launch on my phone.
Looks like it will work fine when development build is checked in build settings, is this something that needs fixing? As long as i can upload a reg build for google play i wont care
Hey, I'm trying to make a button work as suggested to me earlier in this channel, but the clicking the button doesn't seem to do anything. I assumed that I just had to select the audiosource's play function here in the button, but nothing happens. The audiosource does have a sound clip set to it.
OnClick seems to never occur, even when I click on it.
There is, correctly, a graphic raycaster, and raycast Target is checked on.
There is an EventSystem in my scene.
@noble agate I'd add another handler there with a simple script like public Test () { Debug.Log ("event works"); }
also check that your audiosource is not Play on Awake
I tried both those things, and unfortunately nothing. The button doesn't even look different when I hover/click it.
@noble agate what's about layers? What is on raycaster settings?
I'm not using layers anywhere in my project.
I can show my raycasyer settings once home.
Anyone have any advice in my apk issues?
Hey guys. Anyone experienced with AdMob? I setted it up and works almost perfectly. My game is based in one main scene only, that reloads everytime the player needs to try again. So, the first time the game/scene runs, the reward ad works prfectly and call the reward event properly. But after the scene reload (try again), the ad plays, but gives error when reward event is called. I already tried to use DonDestroyOnLoad to the gameobject wich the AdManager is attached, but did not work. Can anyone help me solve this? Thanks for now.
@sterile swallow check LogCat for errors to see why it's crashing
Whats log cat?
@sterile swallow Search for Android Logcat
I can't make resolutionScalingFixedDPIFactor in quality settings to work on ios, while on android everything is working. Any tips?
Aww man i cant use this im allergic to cats
But real talk is it an android app? Or how can i use it from just my phone
It's an appliucation included in the android sdk, u run it from a command line or ide
Hello, im using LeanTouch asset. How i can add force to gameobject based on finger position on the screen?
@sterile swallow there is also a package from Package Manager in Unity, you can install and use it inside Unity to check the logs and see why your app is crashing
@sterile swallow or use such a command (your Android SDK path may vary)
"C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" logcat -s Unity ActivityManager PackageManager dalvikvm DEBUG
Ok, this means the device needs to be connected to my pc? If so, for some reason build and run isnt working with my android, ive been having to create the apk and then put it in my android's download folder
@sterile swallow yep, make sure USB debugging is ON
I have question how can I scale a mobile game to be full screen even when the phone does not have a squared screen but the screen has the camera on it
Right now even when full screen is enable the game does not take the entire screen
It starts bellow the camera
check player settings, mobile section
there should be a checkbox that says something about the safe area
that makes the black bar appear or disappear
I have "Render outside safe area" enabled
this is also per device setting since android P. users can disable rendering apps in the area of notches and opt into a black bar for example
I have played games in my device that do not have this black bar tho
make sure u r using the newest android sdk too
Hi guys
Send me your android games made with unity
I would like to test that games and give my personal opinion about them
Im trying to have my object moved by touch in a way that when i begin the touch anywhere, moving my finger by 2m in world space, player will do the same
so i I'm trying to do that this way:
touchedPos = Camera.main.ScreenToWorldPoint(new Vector3(touch.position.x, touch.position.y, 0.3f));
firstPos = Camera.main.ScreenToWorldPoint(new Vector3(basePos.x, basePos.y, 10));
float diff = (firstPos.x - transform.position.x);
transform.position = new Vector2(touchedPos.x + diff , transform.position.y);
but what that does, is it makes the first touch pos the "center" and moving left/right moves my object
Hey guys!
Imagine that this "Share" button is Disabled. ok?
https://prnt.sc/qh68t2
-So I need to enable this "Share" butotn with GameObject.Setactive(true) when the QR code has finished reading.
How can I do that?
No, I mean..
I know how to Active and Disable objects in Unity. But I need to know "when the qr code has been read" then I Active the "Share" Button.
For example, when the QR code is read then it displays a 3D model automatically. I need to do the same but with the "Share" button. I need to display the "Share" button only when the QR code is read
this is my code https://hatebin.com/zndtjbrhye
@noble arch it says build failed with exception, and displays 113 errors.
after usb debugging etc and attempting to build and run on my phone
main issues were : Execution failed for task ':launcher:packageDebug'.
java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.signing.KeytoolException: Failed to read key build from store "C:\Users\mgiga\Desktop\AndroidKeystores\DigGameKeystores\DigGame.keystore": Keystore was tampered with, or password was incorrect
@sterile swallow are you using a keystore?
Yes, reset the keystore and changed the settings in the backend and now ti works
Hi, how do you manage your user authentication? I want to have user data stored in the the database, but dont want to necessarily create register screen. I am aware that might turn off new players as many dont want to register as it takes time. So i was wondering if it is possible to just get GameCenter email on iOS and GooglePlay email on Android and use that for automatic user registration. As far as i understand there is some Social api in Unity, but it does not mention much about GooglePlay. Is that a reliable way to get user's email or id or is there some better way to do this?
Has anyone solved Android audio latency? Seems that all audio plays with a delay on my Android, regardless of what settings I use, even though the files have no leading white noise.
Anyone know why my app doesn't require the permissions I set when it starts?
I did add them in the manifest and I'm using unityengine.android
@noble agate on which unity version? What device and android version? Compression settings and format of audio track? I didn't experience such issues
@noble arch
I've tried every combination of compression/format settings I can think of on the audio tracks. They audio tracks are short sound effects. It's the latest Unity version, and I'm testing it on a Moto G7 Power (2019).
I'm using Android 9, and neither Vorbis nor PCM or the third format work well for me. Each has a half-second delay.
Sometimes they're skipped altogether, or have a distortion when played (even using a 2D audio source)
And you checked that files itself dont have silence, f.e. if you see in Audacity?
They don't.
Did you try them in a blank project?
They have zero delay when I play them in the editor, or in a computer build. The only situation in which they have delay is when I run it on Android.
Which unity version?
2019.3?
Oh, my bad. It's:
Try in an empty project to make sure it's a files/unity issue and not your additions
If that's unity version thing try installing a different one, f.e. 2019.3 with vanilla android sdk
How do I know what Android SDK I'm using? I followed a youtube video to implement my SDK a while back.
Also how are you triggering the audio play?
If you install via Hub there's an option to add tools for Android build support
Oh, cool. I'll try doing it through the hub.
All the audio in my project is subject to this issue. To try to diagnose the issue, I've tried putting a line of code which says "if a touch begins this frame, playOneShot", and even using that, it's still got a half second of delay.
Play one shot may have some issues iirc
Try just Play
I also tried it with Play, and saw no difference.
However, PlayOneShot is necessary for most cases in my game.
Does the delay happen on each call or only for the first one?
Every call. For example, I have a button (not a Unity button, a home-made one) where touching it should play a hover noise. However, every time you touch it, the hover noise waits half a second before playing. And if I press the button quickly and repeatedly, then the audio source seems to panic and sometimes even skips the noise.
Also did you try on another phone?
I haven't tried on another phone yet.
Maybe some weird driver glitch
I'll try using the vanilla SDK from Hub, and see if that changes anything. I'll get back to you.
Thanks for the advice.
What about audio Spatializer? Did you try to switch it?
3d doesn't change anything I guess? Well I meant another thing in Unity settings
Oh, where would this be?
Ah, I'm using none.
Try change that too + 3d space
The only option is none.
Is this what I need to select to get the vanilla SDK? Once I get it, do I have to change anything in settings or build settings to use it instead of what I currently have?
@noble agate yep that's it
Also check if your audiosource settings are correct - try to reset them
Will do, I've now reset the audio source. The only thing that seems to have changed is the Play On Awake though, which I turned off.
Regarding the update, do I have to change anything in settings or build settings to use it instead of what I currently have?
Don't forget to backup your project
I did.
Then you just open the project with another unity version in hub
But I'd start with a blank one
Oh, I mean the Vanilla SDK. Since I assume my project settings are going to carry over into the new Unity version.
Will the old SDK still be selected in my project or something?
Not sure, you can go into new unity - preferences and see what's there
How will I know which one to select? What will the vanilla SDK be called?
And yeah, I'll try a blank project too. Just waiting to finish the update.
Built-in in Unity
@noble arch Okay, I finished the update, and looked in my settings. This is what it says about my SDK:
Seems I'm missing the "recommended" Android SDK tools, even though I selected to install Android Build Support when updating in Unity Hub.
How do I get this recommended version?
Not sure, maybe some unity folks may know better
@finite storm you may need some code to force show permissions
i did download a plugin-ish
AndroidRuntimePermissions.Permission result=AndroidRuntimePermissions.RequestPermission("android.permission.WRITE_EXTERNAL_STORAGE");
but's not workin
@finite storm
Hm... I tried unchecking the little check mark, and checking it again, and restarting Unity. Didn't change anything. Still looks the same.
Or did you mean restart my computer?
no i meant unity
Hmm
it worked for me I have 2019.3.0f3
did you look in unityhub to see if it says anything ?
Does anyone know if the android keyboard that comes up by default somehow overrides the Input field?
I've got an input field in my app that a user can enter text into, and a button below it that has onClick event to run a script. when i build that to my device, it doesnt even run the on click event at all
i ran the debugger and im getting this
even though everything is fine on the pc im using
@noble agate why not 2019. 3 though? Did you try in a blank project yet? Does it build with what new unity has by default (wrt android sdk settings)?
@half lodge your problem is another crash, you should check your code closelly, some missing scripts and etc after fixing those it might work
Check line 334?
can i post a help question in this channel relating to android builds?
How do i fix this, trying to upload my APK to google play store and keep getting this. ive read every forum on the issue but cant solve it
Guys, I was making an android game. When I deployed my game into my phone, When I export it in Portrait(9:16), border areas on left and right are invisible
#💻┃code-beginner Guys, I was making an android game. When I deployed my game into my phone, When I export it in Portrait(9:16), border areas on left and right are invisible
picture?
One sec
This is how it should look like in the editor. please note the borders
But in phone we can't actually see the borders
well, just make the game area abit wider then
You mean, to scale up the camera coverage area
or not as wide, whatever direction you need to expand/shrink game area to fit screen
But In the game preview window,there is not misfit
I'm nnot able to monitor how much area will be cut off while it came to mobile
i have this issue alot with canvas'. though i just do trial and error
if it doesnt fit this build, change it, rebuild and see
are you using Unity 5 remote viewer?
highly recommend for this sort of stuff.
remote viewer?, Idk what it is
it streams the game from the computer to the phone
its an app on the app store, download it and use that
Okay ,let me try that
But what if our app is opening in a phone with different resolution?
if its not a canvas, i think it'll try scale to device (i think)
if you're using canvases, you need to select "scale with resolution" in the canvas settings
once you get unity remote 5, you'll understan
phone needs to be connected to computer via a suitable data transfer cable, and all the trusting things you need to accept on mobile
only if you need it
it is for UI elements such as game names, buttons etc
Okay so in my case it's not because there is no canvas , right?
The message in your screenshot is not visible
I had heard that while building game for uploading to playstore, just like for ARMv7 we have to make a build for ARM64 as well
Otherwise there will be a permission deny
Idk know much abt it
I just had heard like that
I tried that. Now everything just fit in, but the screen looks compressed
Balls are oval shaped instead of circular
is it all one sprite?
Balls are instance of same prefab
just scale the game area, not the objects inside the game area
Is there a way to test IAP prices without an alpha/etc being published? I got all these notifications that my app could take up to a week to get published into alpha but want to try out the IAP now.
or alternatively, is there a way to ensure my app gets published faster? The messages were dubious like it could take a week or weeks, and their "live support" is from 12 am - 12 am so does that just mean they don't have any?
only one way to find out. contact live support 😛
it said 12am-12am gmt so thats 7 pm my time, guess ill give their 1 minute live support a go
but about the IAP, any way to test that without publishing?
google play store?
if so, no idea sadly, i cant even upload my APK with the issue ive got
it says you need a privacy policy
kinda like other mobile apps have when you sign up
for a game that requires no user data, you dont need a privacy policy
Hello
the animator fade-in on phone doesnt work
anybody have ideas how to fix that?
has anyone had issues with illcyp or whatever 64x versions of their android apps?
I heard it can mess with google's IAP, and currently my IAPs work in my editor but not on my phone once the build is uploaded to google play
"IL2CCP" is the actual name lol
It fixed itself after like an hour, weird
#💻┃code-beginner #💻┃unity-talk Guys I was making a 2d android game. I want my prefab to be spawned while starting game. It woks well in Editor but not in the game preview window anybody know why?
I need some help with my 3d android game. I have a basic script that literally just check if the screen was touched, and if it is then it will AddForce on a cube upwards. It works fine the only problem is that sometimes when I click the screen it add more force to the cube sometimes, while other times it doesn't. If I change the input to my keyboard on my pc, it is always the same force that is applied, so there must be something wrong with the touch, either if it detects that I press multiple times or anything else.. i don't know
(Sorry for poor english)
@analog marsh what do you use to check if the screen was touched?
do you use GetTouches or Input.GetMouseButton ?
In the update loop I use this
foreach (Touch touch in Input.touches){
if (touch.phase == TouchPhase.Ended){
}
}
I mean TouchPhase.Begin but I tried ended to test
Began*
are you also using Input.GetMouseButton?
clamp the add force?
Yes @sharp quiver
You need to set Input.simulateMouseWithTouches = false; then
or not use Input.GetMouseButton when not in editor
or not use the Touch method
I just used GetMouseButton just to see if it worked
oh i thought you meant you had them both in your script at the same time
No mainly i will use the Touch only
Is it because the game believe I touch the screen multiple times?
And then call AddForce multiple times?
Alright I do it later, not at my pc atm
i need some help with unity ads yall
I have my ads set to run every 5 deaths in game, and to not run if a no ad thing is purchased, and it works when i build and run to my phone. but when i load it as an alpha build from google play it runs a unity ad every 3 deaths and does not take notice of disable ads
ok Google, ummmm..... it was an issue with the app on the store running a script that wasn't even attached to any objects in the game, it was an old ad script i had in a folder called "unused scripts"... deleted it and it works now
hmmm, i actually do have a privacy policy set so i havent seen that
do you have one? they are usually free to find online for general policies
could you show me please aha
i used this one and only used the free options: https://www.termsfeed.com/privacy-policy-generator/
Privacy Policy Generator for web, ecommerce, mobile iOS & Android apps, SaaS, Facebook and more. Create Privacy Policy in 4 steps for 2020. Includes CCPA, GDPR, CalOPPA.
tyvm
no prob
can i pm you quick?
sure
@sharp quiver It didnt work to do that way
Anyone know? :/
@spice frigate in the settings, you have to turn on an 64x stuff, i dont know what is the name, watch a tutorial.. 😅
If you are getting error that says "This release is not compliant with the Google Play 64 bit requirement" then watch this video: https://youtu.be/efZbaJ0tbbU
Starting August 1, 2019, your apps published on Google Play will need to support 64-bit architectures. 64-bit CPUs d...
Guys, what will be initial touch.Count if ther are no touches in the screen
Thanks lion :)
no problem!
how can i come up with MOBILE GAME ideas fast?
random game theme generator
umm
i try it.. 😂
thats literally story ideas for pc
Hey guys, i'm making a game for mobile but i have some troubles optimizing. My phone has some trouble running it though. After some experimenting i decided to export a completely empty scene to my phone, with only the camera as an active object. However, it seems to only run at about ~30 fps. Looking at the profiler, The 'other' category seems to take about 10 times to finish compared to the other categories. I'm not sure what to do now, any ideas?
Anyone know how to solve this? I tried changing the version code in unity but that didnt work and now im stuck
you also need to update the build code,the one under version code too
ok ill try that
Do you know why when I load a png file from StreamingAssets folder in a texture it displays as a question mark?
A question mark reperesent a image that cound not be loaded / is not valid.
know how i can delete the alpha release? Ive been trying to google now for some time but nothing works..
ive also been doing this today, i think if you create a new one, it just over-writes the previous
Yeah i made the beta one but that didnt overwrite, also i just want the alpha release to be gone from the console so i only have the beta there
is the new input system good to use on mobile games? or should we be using the old input system?
Hello guys, is there any chance that i can use water with shader for mobile game? Everything i tried is very expensive for mobile devices
Hey all, does anyone know where i can see the full feedback from my "Submit for Review" on iOS. They have given me "Invalid Binary", and im trying to see details 😛
nmd 🙂
Hey guys. I just updated my project from 2017 to 2018 and now when I build to android, my movie player does not work / renders PINK. I have tried adding the shader to the "Always Load" in settings, and I have created a dummy texture that uses the shader in /Resources. I have no clue why this is happening.
I am using Mobile Movie Texture asset, which is seemingly no longer managed.
Unity Movie did not work for my purposes.
Evening. Not sure if anyone can help me with this since its a little obscure, but I'm looking for a way to check if a firebase user is signing up for the first time. Google, in all its wisdom, has told me that I can use AdditionalUserInfo.isNew() after a login result but it's just not there. I'm using facebook to log into firebase.
Hey guys. Anyone familiarized with Google Play Services? I would like to ask something. My game was running very smoothly on every Android Device I tested so far, even the 2016's low end ones. But since I implemented Play Services API on my project, the performance became terrible, cause the game started to stutter and the average frames per second is near half than it was before. I expected that after the API was implemented, the performance may suffer a little bit, but the way it happened to me make my game almost unplayable. Someone else experienced something like this? Do you have any tips? Actually I did not profile my game yet, as I will do it tonight, so maybe I can find more information about it. Thanks for now, peace.
@brave crow it really depends on the way you are using Play Services and what part of it exactly. Can't really help with no information
Hey @robust hamlet Actually I'm using just Sign In and Leaderboards, no achievement neither cloud saving yet.
I'm trying to use IAP, but I'm waiting my app being approved on Play Console revision.
it's google play games, not google play services
you should profile your game to see what cause that lag
at the beginning it's normal to have some lag while trying to login, but it depends on how you are posting the score for particular leaderboard
@robust hamlet About lag in login I expected, but it happens during all the game. I'm posting to Leaderboards only in a function called at the end of the game round, so I think it's not the issue. But I will profile it and come back again with more info. Thanks man.
You should check logs too, maybe there is something else which is happening because of play games
I forgot how long it takes from upload to google play till its puplished. Anyone who can tell me?
3 days?
When you select an app on your Play Console, you can see your app's latest publishing status under the title and package name.
Whether you're publishing an app for the first time or making an update,
It just says waiting for puplish
Read the publishing status section.
@robust hamlet Sure, I will. Thanks for your help man.
@snow whale have you used a different render pipeline? go into your assets folder, locate a prefab/sprite. right click it and select "reimport all" should fix it
Hello Everyone,
im having a weird issue with my game, when limiting the FrameRate on mobile the Frame Rate will get High Variance.
my game is stable at 60fps but when limiting it to any number between 30<>60 the frame rate get constant variance
this is how deltaTimes looks like at 40FPS in build (0.03308875, 0.00001, 0.03309203, 0.03311411, 0.02692817, 0.006139117, 0.03307073, .......), but stable at ~0.025s in editor which is really weird. at first i thought the problem was perfmance but why when setting it to 60 or -1 it gets perfectly stable frame Rate 0.016~ ? this means it's not related to resouces problem but unity frame rates it self.
does anyone has any suggestion ?
@spice frigate That didn't work. :(
Are you using a different render pipeline from the "stock" one?
Where do I check that?
i cant remember off the top of my head, let me open a project
Edit < render pipeline < lightweight < upgrade all to lightweight
if you have that
Has anyone ever implemented Apple Search Attribution on Unity?
I cannot seem able to get the plugin code to return anything 🤔
Okay, I've updated to 2019, and I have switched to Unity Video Player. IT seems there is no way to access the filestream of the player?
I need to download a video that is streaming, or stream a video that is downloading. On mobile this doesn't seem to work.
IT reaches the end of the file, and stops while it is streaming from a downloading file.
It reaches the end of the first buffer, I guess I mean
@uncut lark but reference it the right way round. use 1920x1080.
Thanks!
np broski
I am still struggling to test my project on my android device, every time I click play nothing happens to the Unity remote 5 app
-USB cable is connected
-USB debugging is enabled
-Editor changed to any android device
-Build setting is android
-Unity remote 5 installed and running
Devices: Samsung S9+ and Windows 10
is the game build set to android?
yup
have you enabled develeper mode on device?
Yes thats how i enabled USB debugging
have you set your phone as testing device?
The unity remote device setting is editor? yes
My cable is fine as I am still able to transfer data from my laptop to phone
Watch the brackeys tutorial on it, that worked for me
Can't find the video, you have link?
Let's learn how to make touch controls in Unity!
GET UNITY PRO: https://on.unity.com/2N3FACS
● More on Unity Remote: https://bit.ly/2OehNon
● 2D Shooting: https://youtu.be/wkKsl1Mfp5M
♥ Support Brackeys on Patreon: http://patreon.com/brackeys/
···········...
Hello, can i somehow control vibration, i mean, i want to get very satisfied vibration. For now i am using code Handheld.Vibrate(); but i feel like it lasts too long. Can i lower duration of vibrating?
Edit the duration in the Handheld.Vibrate script
or make your own vibrate function
Thanks!
So, I have a project in android studio, from which I need to open a unity module, and send data to the unity module.
https://medium.com/@angelhiadefiesta/integrate-a-unity-module-to-a-native-android-app-87644fe899e0
Tried following this link but to no avail after Step 4. Someone told me something about fragmenting the main activity ?! Any insight will be greatly appreciated!
I have a problem with a texture used with a custom shader on mobile. As you can see, the texture is not biliear interpolated. On PC it is.
I debug logged the texture settings and they are set to bilinear filtering and RGB24.
In the shader I do a tex2D(_DistortionTex, distUV)
What could be the problem?
Hello
I need this:
When I push the button "Share" I want my Application to open this directory in Android device /storage/emulaed/0/Android/data/com.Aplication.myapp/files/
How can I do that?
https://prnt.sc/qkvhm0 https://prnt.sc/qkvhxj
Hatebin: https://hatebin.com/tvwrsoycdp
How do i make my game not react on any touches if any UI elements is touched?
Several ways. Event system known which object is under it (select event system with extended panel to see information at runtime). Also UI can track when you enter it.
Nevermind I forgot to update the obb file, my app is binary split.
help me with that error
for mobile games, should i use standard shaders or change it to mobile/something? What is diference?
Mobile shaders perform better so if they still look like you want them too then it's good to switch
Thanks
Itch.io and Google play store for me
Do you mean for publishing, or for development
Yes, but be aware of their hard and soft limits. https://help.github.com/en/github/managing-large-files/what-is-my-disk-quota.
You may need Git LFS, depending no the size of your assets.
Hi - I have a standalone android application and i want to send a message to a unity3d application, can i use UnityPlayer.UnitySendMessage to do this or do I need to do it a different way?
Do you have an access to source code of both apps?
yes
i am trying to do it via creating an intent now - but my java knowledge is fairly poor compared to c# so i am struggling a bit
I have unity talking to the java app and now i want to send a message back (at a different time)
so at the moment i have this in my java code -
sendIntent.setPackage("maccs2tablet.kprmidlink.com");
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT,"This is my text to send.");
sendIntent.putExtra(Intent.EXTRA_TITLE,"UNITY");
sendIntent.setType("text/plain");
startActivity(sendIntent);```
and this in my unity c#
AndroidJavaObject currentActivity = UnityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaObject intent = currentActivity.Call<AndroidJavaObject>("getIntent");
String text = intent.Call<String>("getStringExtra", "UNITY");
MessagesShow.ShowMessage("Got A Message: " + text);```
I get the message 'no activity found to handle intent' from the java app
though thinking about it my unity code may be in the wrong place as the app i already running and i don't know how to capture the message ?
Am I missing something from my unity manifest to do this?
Added lines into my manifest, and now my app crashes when I send the message rather than it saying it can't be found
just can't understand how I am meant to handle the incoming intent within unity
if anyone could shed some light on this I would be grateful
can you paste the crash log
- on Android / Java your code is a little wrong, if in Unity you want to search for a text with key "UNITY" you should call:
sendIntent.putExtra("UNITY", "This is the message which I want to show in Unity App.");
Ah ok i have changed that - as for the crash log I am not getting anything from logcat that shows a crash, my android device just goes to the home screen and leaves both apps running in the background, but if i press one it restarts it
it didn't do this until i added this into my manifest -
android:name="maccs2tablet.kprmidlink.com.SumUp"
android:exported="true"
android:required="false">
</activity>```
and changed
my java code into -
sendIntent.setPackage("maccs2tablet.kprmidlink.com");
sendIntent.setClassName("maccs2tablet.kprmidlink.com", "maccs2tablet.kprmidlink.com.SumUp");
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra("UNITY","This is my text to send.");
sendIntent.setType("text/plain");
startActivity(sendIntent);```
the activity is in the unity manifest...
the bit i don't understand is where do I put the unity code
its not like im handling an event
do i have to have it in a script where that code sits in start?
@robust hamlet
ah just ran the unity logcat and get this -
2020/01/10 14:30:13.024 14614 14614 Error AndroidRuntime: Process: maccs2tablet.kprmidlink.com, PID: 14614
2020/01/10 14:30:13.024 14614 14614 Error AndroidRuntime: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{maccs2tablet.kprmidlink.com/maccs2tablet.kprmidlink.com.SumUp}: java.lang.ClassNotFoundException: Didn't find class "maccs2tablet.kprmidlink.com.SumUp" on path: DexPathList[[zip file "/data/app/maccs2tablet.kprmidlink.com-xrUiweMUN5fXeBQ7iStyPg==/base.apk"],nativeLibraryDirectories=[/data/app/maccs2tablet.kprmidlink.com-xrUiweMUN5fXeBQ7iStyPg==/lib/arm64, /data/app/maccs2tablet.kprmidlink.com-xrUiweMUN5fXeBQ7iStyPg==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]```
I do have a class called SumUp though
@pine basin Sorry I don't have much time to spend on this, but here is a link which will help you to achieve this on Android side:
ok - thank you anyway
Hey guys, last time I looked into alembic support for mobile it wasn't really there, has that changed at all recently?
Hello, I have a question, I noticed that https://docs.unity3d.com/Manual/webgl-browsercompatibility.html says that Unity WebGL is not currently supported on mobile devices, how can I get a Unity build to run on mobile browsers if not WebGL?
would it not be better to do APK?
it needs to run on a website unfortunately, with the goal to have mobile browser support if possible
looks like Unity requires things to be in Project Tiny to run on mobile browser WebGL, it will require ECS to make :/
https://blogs.unity3d.com/2018/12/05/project-tiny-preview-package-is-here/
https://forum.unity.com/threads/project-tiny-fall-update-tiny-racing-preview-3-020-0-is-available.792999/?_ga=2.240007307.907570158.1578322194-1753194799.1547569693
I have been messing around with webGL on mobile. It's not production-ready environment, but.... the client got what he wanted. You basically need to go to the generated .js file jumpboard and remove the lines that check for mobile browser
interesting, I will give that a look Simon, thanks!
@twilit bluff This isn't a place for it.
What do you mean
If you are seeking collaboration use Unity Connect
Should my game be published on the google play store for the services to run or is it fine if I have set them up on draft?
huh
is this channel for mobile users typing on discord or discordians discussing on mobile games
@glad acorn Yes, you need to publish. At least to internal track
@broken tree
Ask questions, discuss, and share anything related to mobile development!
o
When I am trying to publish my app I am getting this error This release is not compliant with the Google Play 64-bit requirement the x86 is disabled in unity player settings tho
i had this issue
you need to use LLCAP or whatever its called. let me find the forum page for you
IL2CPP
thats what its called
Lemme try again
The Unity Manual helps you learn and use the Unity engine. With the Unity engine you can create 2D and 3D games, apps and experiences.
here you go @glad acorn let me know if that solves it and / if you find it
Oh. then i dont know pal, never used linux
Is IL2CPP supported on linux?
it could be. but there is an option to use ARMV64 or something like that, i cant remember the exact details, you miught have to google round abit. there will be a workaround on forums etc
I having an error when I am trying to build however I found online that I should manually install the NDK in Unity I did the error was not solved
did you install the NDK via unity hub?
At first yeah
But I got the error
And after googling I found out that you should install it from the official zip
I did that
But the error still exists
you might need to go into preferences and assign the NDK
The NDK is fine Unity has recognized it as it should do
So after examining a bit more the huge error I found out that it does not have the permision to use this file /home/dimitris/Documents/Block rush/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/583E6FDCD0E7695E90227FAAAF784053.o. The file does not even exist though any idea?
This is the exact error that I am facing
Gimme a second I got an idea
Nah
It did not work
Well It kinda did?
I mean now I am getting a smaller error
So I just marked clang and clang++ as executables manually
What is the unity hub default ndk version?
Im not entirely sure, i think it depends on what version of unity you are running
I'm going to try to reinstall it manual
Okay so I installed the NDK manually
Now I am facing this error Error building Player: Win32Exception: ApplicationName='tools/bin/sdkmanager', CommandLine='--list', CurrentDirectory='/home/dimitris/Documents/Block rush', Native error= Cannot find the specified file
Do you have to use linux?
I have access to no other os
im at a loss mate
Everything was compiling fine when I used mono as backend tho
Yeah I can create apk using mono... IL2CPP seems not to be working
So let me summarize the problem, I am using Unity 2019.2.17f1 on Fedora 31 (with KDE) building the android game is working fine using mono but google play store requires 64-bit support to the app so I have to swap to IL2CPP but that won't build the app despite the fact that the il2cpp folder exists
when setting IL2CPP, have you also ticked ARM64? it is not visable if IL2CPP is not selected, and ARM64 is located just below it, as a tick box
@glad acorn
Yeah I have enabled ARM64
still same issue@?
sorry for the slow replys. @ me so i can see you sent a message 😛
holy fuck minons art is on here
anyway yea @glad acorn
Why is my application only detection my front camera?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class PhoneCamera : MonoBehaviour
{
private bool camAvailable;
private WebCamTexture backCam;
private Texture defaultBackground;
public RawImage background;
public AspectRatioFitter fit;
public Text error;
private void Start()
{
defaultBackground = background.texture;
WebCamDevice[] devices = WebCamTexture.devices;
if (devices.Length == 0)
{
error.text = "No Camera detected";
camAvailable = false;
return;
}
for(int i = 0; i < devices.Length; i++)
{
if (!devices[i].isFrontFacing)
{
backCam = new WebCamTexture(devices[i].name, Screen.width, Screen.height);
}
}
if(backCam == null)
{
Debug.LogError("Unable to find back camera");
error.text = "Unable to find back camera";
return;
}
backCam.Play();
background.texture = backCam;
camAvailable = true;
}
private void Update()
{
if (!camAvailable)
{
return;
}
float ratio = (float)backCam.width / (float)backCam.height;
fit.aspectRatio = ratio;
float ScaleY;
if (backCam.videoVerticallyMirrored)
{
ScaleY = -1f;
}
else
{
ScaleY = 1f;
}
background.rectTransform.localScale = new Vector3(1f, ScaleY, 1f);
int orient = -backCam.videoRotationAngle;
background.rectTransform.localEulerAngles = new Vector3(0, 0, orient);
}
}
(mention me)
Whoa, God damn it's live
@spice frigate I can't find it. Is it region specific or worldwide?
Worldwide, I can send you a link direct to the page if you like @safe mortar
<3
I can see myself spending way to much time on that game
Maybe if you walk in the right direction, let the player stay looking in that direction.
Currently everytime i go to the right after I let go he looks to the left
Yea. I'm planning on changing the player, as it's terrible. I did everything myself and clearly I'm not good at animation
So I tried to run the il2cpp.exe from my bash terminal and I go the error
bash: ./il2cpp.exe: cannot execute binary file: Exec format error
So I am pretty sure that linux can not recognize the ".exe" file
Anyone knows some good publishers that i can contact?
@here hello friends, can someone help me in unity am a beginner and would have some questions, sorry for my bad english come from germany
dm pls
@rough ravine Please don't advertise your questions in multiple channels. And if you have questions ask them.
@rough ravine stop asking to ask a question and just ask the question you want to ask publicly
I ask if someone can help me so that I don't bother others
most people in here are friendly and will help you regardless of your technical ability
However, generally just ask in 1 channel. if no reply within however long, ask again. but dont spam it
@solemn quail This is not the place to advertize
What? @pseudo prism
Oh thank you man <3 if you could leave an honest review on it too on the app store that would be fantastic
There are no ads in the game @pseudo prism
are you literally just going through all the channels asking for help about getting ads into your game!?
No
Thanks for the rating @pseudo prism <3
Hello everyone!
I hope this is the right place to ask this.
I am working on a Unity app that will run on Android.
For the first time I need to create an Android library that extends the default UnityPlayerActivity.
(For more on what I want to do, you can follow this link: https://www.reddit.com/r/redditdev/comments/3lahqw/authorizing_an_app_from_unity3d/cwqibs3/).
So I have exported the project for android, using Android Studio I am able to edit the code and now I need to create a library from it.
This is where I get struggled. When I go to File > New > New Module > Android Library I am asked to update my project to androidx.* dependencies.
I thought that Unity did come with old namespace libs so I went into Refactor > Migrate to AndroidX but it says that "No usage (is) found in the project".
I don't know exactly what I should do, how I can build a .aar file from here.
If someone could help me on this I would really appreciate! Thanks a lot!
@white sierra Why do you need to extends the default Activity?
In most cases you can achieve whenever you want without doing that, it really depends on your case
@robust hamlet It's a complicated topic haha. Well here is more informations about what I am trying to do (and if there is a better approach, of course I take it).
Goal
Request gmail HTTP api to be able to fetch mails.
How to?
Of course the API is protected, the user needs to be signed in. There are two ways to sign in the user :
- Google Sign In
- OAuth 2
The case of Google Sign In
The package Google Sign In for Unity isnt maintained anymore, even the examples doesnt works. Now we should use Google Play Games. But Google Play Games only works with Android and I need to ship my app on both Android and iOS.
The only solution?
So I have to use OAuth2. The thing is I don't know how to integrate it properly, OAuth needs to run in a browser since google will send us a redirect response, open HTML forms that will be filled up by the user and of course, my whole app have no idea of what happens here because in OAuth, your app never knows the username and the password.
I wanted to do a Application.OpenURI to open the browser. The thing is after the OAuth process I need to get the generated JWT back to Unity. This JWT will be used to make requests to Gmail API. But using Application.OpenURI is not the solution since I can't have the token back. Once the browser is opened, Unity cant talk to it.
I have read this reddit post where someone overrided the default activity (in android) and was able to send the token back from the browser to Unity
UnityPlayer.UnitySendMessage("AccessManager", "OnURI", uri.toString());.
This is what I am trying to achieve.
My point is : if I am able to do that in android, I'll just have to do the same in iOS and everything could be great!
(I hope I made myself clear, english isn't my mother tongue sorry)
So as far as I understand, you want to open a web browser with login and after that get the token to your base activity and do whatever you want to do?
yes 🙂
Since you are exporting your project to use Android studio I don't see why you need to create a library for that
you can extend directly everything inside your projects, without overriding the default Activity
Or, you can create another Activity which you can use to communicate with the web browser / getting token and return everything to base activity
this is the part when I am a newbie: in order to do so I need to export my Unity project to Android (to generate the android studio project) right?
yep
Or you can create a library which does that and import it inside Unity project
this way you need to create a Java Wrapper in Unity to be able to use the library
so maybe this is my issue: I'll work in that Android studio project but whenever I'll work on Unity, I'll have to generate it again and redo everything, this is why your solution based on a library sounds good to me.
I thought that creating a library was about making a .aar file that will be read by Unity!
I'll read some docs about creating that Java Wrapper around Unity 🙂 Thanks a lot.
Was about to sugest you import the library
suggest*
also you shouldn't need to open a browser to oauth if you don't want to
I think you should use Google Play Games for Android and use something else for iOS
Have you tried this:
https://github.com/googlesamples/google-signin-unity ?
@pine basin interesting, I dont know about this. How the user can fill up the forms and provides its credentials to the provider?
@robust hamlet seems the easier solution and it seems easy to maintain too. But maybe I havent searched enough the thing is I cant see something else for iOS. This lib is the one that isnt maintained anymore.
if you are unsure you could take a look at the following assets - or maybe at least sneak peak the documenation if you don't use them to give you some ideas
https://assetstore.unity.com/packages/tools/network/web-api-kit-core-19663
https://assetstore.unity.com/packages/tools/network/web-api-kit-oauth-token-interceptor-extension-40572
WebGL Demo | Support
Build maintainable REST APIs on top of popular HTTP clients such as BestHTTP , UniWeb , HttpClient , UnityHTTP and Unity's built-in WWW and UnityWebRequest.
1-2-3 SETUP The process of building your API is done in three easy steps us...
we used this originally within our company they work well
we have an android app also that works via oauth though not through to google services theres no reason it can't
those links came up a bit larger than I thought they would - sorry !
Haha, thanks a lot to both of you! I'll retry Google Sign In, maybe I missed something. And I'll also try out those packages. Just to make sure of something: @pine basin you can read your JWT tokens from Unity?
yes
Okay @pine basin . Thanks a lot for your help!
So I built my game using IL2CPP and I built an app bundle, however I am getting this error on google play when I am trying to upload my app Your Android App Bundle is signed with the wrong key.
i had that few times, i just created a new keystore
glad you fixed the old error 🙂
I use a 3d model in my unity app, I made the model with UMA. It works perfectly on my computer, when I test the app on a real phone, the model's shirt rips.
is this the right place to ask?
If its about a mobile application, then yes
it is
@spice frigate I did not, I just understand that I would lose too much time trying to fix it so I dual boot my system using 60GiB for windows 😂
well, atleast you got a work around 😛
any ideas as to how to stop a 3d model's shirt from ripping during transfer to a phone?
not entirely sure what you mean potion
I put an animated 3d human model in my app. when I test the app on my computer, the model looks normal.
photo etc?
but when I build and run to a real android device instead of the in engine test the model appears with holes in the shirt
hang on
do you have unity remote 5 installed on phone? for actual testing
google play store it
plug the phone in via a suitable data transfer cable
run the game, and it shgould displayt on the phone
flip your phone to whatever orientation you're wantingf your game to displayt
its replicating the game from your monitor onto the phone
have you tried making the shirt on the model Slightly bigger?
show me the hierachy
is scarlet your women model?
not exactly, its where I store the model's programming
do you know if the shirt mesh vertices are modified by a vertex shader at all? Precision on mobile is usually half of desktop
im not sure what a vertex shader is
oh, sorry. Meshes are rendered in Unity by giving them a material. In unity a material has a shader that is used to color the faces of the mesh. On top of that, the shader can also modify the vertex positions if needed.
find the shirt model on the object, and enlarge it, is the easiest way. if its a seperate object
I created the model in engine, then saved it to a string called recipe
the hirearchy appears after I run the app
found it
how do i increase its size
?
gotta go
Sorry I was afk. Just use the scaling tool
im back, how do you change the size in the inspector
I can't find the mesh in my avatar, but i can find it in my files
Never used UMA what whatever it is, so I'm not the best person to ask. Try asking in the 3d models section
ok
i forgot how long it takes to compile a 64bit game, Holy moley
I still need some help with getting my stand alone java application to send a string across to Unity if anyone is available who knows how to do it
@pine basin Were you able to manage using UntiyPlayer.SendMessage? If yes, could you share how, stuck on it :/
No - I don't think I can do it that way unless it is a java plugin inside unity
I have a completely seperate application
so i am trying to do it via Intent
In my case, I have an android application, which needs to open the unity module and both run parallely together
your unity module is inside the android application? or seperate app
seprate app
you are trying to do similar to me then
i can send messages from unity to the java app, but not the other way around at the moment
Wait lemme explain more in detail.
I have an android app, to which I added a Unity module.
This Android app is the main app, and needs to open the Unity module and send realtime data to the Unity module
Someone told me that I need to fragment the Unity Module Activity but I really have no idea of Android Studio projects
@pine basin btw how did you manage to send from Unity to Android? Using UnityPlayer.SendMessage only? Can I get the scripts for them?
AndroidJavaObject ca = up.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaObject packageManager = ca.Call<AndroidJavaObject>("getPackageManager");
AndroidJavaClass intentClass = new AndroidJavaClass("android.content.Intent");
AndroidJavaObject intent = new AndroidJavaObject("android.content.Intent");
intent = packageManager.Call<AndroidJavaObject>("getLaunchIntentForPackage", "maccs2tablet.kprmidlink.com.sumup");
intent.Call<AndroidJavaObject>("setAction", "android.intent.action.MAIN");
intent.Call<AndroidJavaObject>("addFlags", intent.GetStatic<int>("FLAG_ACTIVITY_NEW_TASK"));
intent.Call<AndroidJavaObject>("putExtra", "SEND_COMMAND", "LoadLogin");
ca.Call("startActivity", intent);```
unity3d code to send over data
then in MainActivity in onCreate in the java app I do
Package = intent.getExtras().getString("SEND_COMMAND");
if(Package.equals("LoadLogin")){ ```
so basically i pick up the commad i send over and run the equivalent code i want
Thanks! This should work out for me too then!
@pine basin still need help?
Well, I could use it
@robust hamlet yes I still can't get any comms back to my unity app from my stand alone android application - I have even moved onto possibly using a file now, but files are hidden on internal storage which presents yet another problem!
have you tried with broadcast receiver?
I don't know what that is?
If you don't have a latency issue then you could try Firebase
both apps are on the same device in this instance
basically my unity3d app is controlling a java app which is processing mobile chip and pin payments via a card reader
and i want to send back the receipt details to my app
it takes payments fine - just can't send the data back at the moment - googling broadcast receiver
this is the android documentation
the idea here is that you should create a broadcast receiver in library and import it in your unity app
than you can registerListener for that broadcast receiver let's say in Start function in your MonoBehaviour and unregisterListener on OnDisable let's say
in your other java app you just need to send and intent with the right action and the data
and if your broadcast receiver is registered as public / that means other apps can send data to it, you should be good to go
but be careful, you need a way to validate your data, because in this situation every app will be able to send intents to your app and can send invalid /fake data which can make your app crash
how do i increase the reponsiveness of my buttons? i mean ive put the number to 1million, and the player still stops moving if i tap 2 different directions too fast
(Touch controls)
I need some help with writing files on iOS13, before, I used the following to extract values of a textbox:
string writerFile = Application.persistentDataPath + "/*.txt";
I could then go to iTunes to extract the created file from the App. Now the file won't get updated anymore. (Ever since the update to iOS13)
I guess there were changes made so that persistentDataPath doesn't work anymore. Is anyone aware of what else I could try?
Hey guys. Anyone experienced with Google Play Games (Android)? I implemented the funcionality at the point that it's working, but not the way it should. I also saw that GPGS brings many problems to other developers. While opening savegame, there's a paremeter called DataSource, and the options are DataSource.ReadNetworkOnly and DataSource.ReadCacheOrNetwork. I use DataSource.ReadNetworkOnly, because I must prevent the user from using local/cache savegame, so I must force network savegame. But even if I start my game with the device disconnected from internet, the cache savegame is loaded (after an exactly 60sec timeout trying to load network data). So, even with DataSource.ReadNetworkOnly, it's recovering savegame from local storage. Can anyone help me with this? I searched all the web, but it's terrible to find anything about GPGS. Thanks for now.
How do you solve this with notched phones?
You can use https://docs.unity3d.com/ScriptReference/Screen-cutouts.html to find the cutout areas. @spice frigate
@chrome phoenix so there would just be a black bar their instead?
Well, that's a design question I suppose. You could make the text avoid just the notch area using the cutouts, or resize the screen rect using https://docs.unity3d.com/ScriptReference/Screen-safeArea.html and have a black bar. Up to you!
Does anyone know in addressables if duplicate asset warnings from analyze each load their own reference in memory?
For example I have a prefab with references to a sprite atlas that is also in a scene and let’s just say one resource as well. When I analyze the build it gives three errors if I load the prefab scene and addressable would I have three copies of said sheet?
I am facing an error with my app, I have built it using IL2CPP from Unity 2019.2.17f1, the error was detected from adb 01-17 17:44:56.728 15583 15598 E Unity : (Filename: currently not available on il2cpp Line: -1)
The game is running perfect from the editor
And when I am compiling with mono
But I have to use IL2CPP for the ARM64 support
try compiling to your host platform with il2cpp and see if it craps out
What about the google play services libraries? They are designed for android, won't building for windows fail due to them?
@vocal junco Erm, I can't see the message here but I saw in the notifications so
Basically the android app is calculating a position from the camera, and then these values are supposed to be sent into the unity module so that it will use these positions to render some things
When I try building for Android, this error shows up. But I installed the Android SDK modules via Unity Hub. What could I have done wrong?
Here are my installs:
Hi, I am new to this industry and I have a little question that grinds me, I do not excel in mathematics and my question is, how much math do you have to do a car type simulator game, simulator bus for android and tell me like what math stuff I have to learn, formulas, etc.
learn.unity.com is a great resource for starting out and might give you an insight into what you dont understand.
Is anyone familiar with these warnings when building for Android?
they're warnings
I'm asking about the meaning of the warnings.
Whenever I build my project, I get these warnings, and then the build doesn't work on my phone or computer. (Even though it works perfectly in the editor)
I have no game object called "NoAuthObjPrefab" or any of the other mentioned names, so I don't know what any one of these warnings are referring to.
I'll try reimporting, and report the results.
Okay, I reimported my project. I still get one warning when building, and the build still doesn't work (even though the editor version does). This is the warning:
When I play my game in the editor, it works perfectly, with no issues. However, when I build it and play it, it crashes as soon as it reaches the main menu.
I'm using Unity 2019.2.18f1.
@spice frigate
I'm afraid that's not my issue. The same crash occurs whether I run an Android build, or a Mac build.
I've made this game work on Android many times before. The problem only showed up this morning, after months of developing this on Android.
Hm... I've read through this page, and it doesn't seem relevant to my issue. I'm not sure what to take from it.
thats the warning message you hjave
Yes, it's the same type of exception (UriFormatException). However, the exception in the link you provided says:
UriFormatException: URI scheme must start with a letter and must consist of one of alphabet, digits, '+', '-' or '.' character.
Whereas, in my screenshot, it says:
UriFormatException: The URI is empty
For that matter, my situation is nothing like the original poster in that link. I have not created a package of my own to import. My warning does not appear when booting the project up (It appears when building for Windows/Mac/Android). And unlike the situation of the poster, my game crashes.
I'd appreciate more substantive responses.
then i would recommend doing some research yourself.
@noble agate Regarding the warning you have a script that you've either deleted or renamed, and now all the placed that used to use it don't know what happened to it, so they "freak out".
That implies that the components that you use to have on there will no longer run, so things might not work as expected.
@sour oyster Hm... what confuses me is that I have never used "Unity Performance Reporting Service". So I'm not sure why any of my components would be related to it. I don't even know what this service has to do with my project.
I'm not aware of having deleted, renamed or replaced Unity Performance Reporting Service, since I've never seen or heard of it before.
I'm not worried about that warning. I was thinking of the other warnings that said that prefabs were missing scripts.
Ah, that. That's something I've solved. The issue remaining is the single warning, the UriFormatException.
disable this? https://docs.unity3d.com/550/Documentation/Manual/UnityPerformanceReportingSettingUp.html
The Unity Manual helps you learn and use the Unity engine. With the Unity engine you can create 2D and 3D games, apps and experiences.
I'll try that right now.
Hm... looks like I don't have anything enabled there to begin with:
Then I'm unsure why it complains.
If it helps, I think I added TextMeshPro to my project for the first time earlier in the same morning that I discovered the warning. So is there any chance that could be related? (I don't have any TextMeshPro objects in the hierarchies though)
Hm... I don't see any illegal characters in the folders or filenames within my project.
try building on a different version of unity, see if that works
I'll give that a try. I'll use a Unity version from a couple months earlier.
Make sure its a stable version though
Definitely. My current version is stable too.
can someone help me
maybe tell the problem and people could decice if they can help or not
can someone tell me how to create reflections in game
@twilit niche Have you tried searching in Google?
First answer: https://docs.unity3d.com/Manual/class-ReflectionProbe.html
Windows defender prevents Android support module for unity from running?
So in the future I plan on trying to write a mobile game and I've got a question: how does one test mobile games on their mobile devices?
For inital testing i just put the APK on itch.io as a draft and download it on my phone
Or you can install Unity Remote 5, which streams the game to your phone so you can test it that way
@austere swallow
But streaming to your phone won't test the phone's ability to actually process the game
Then the first option i wrote
Tbh I've never heard of anything you wrote there 😂 I'll do some googling
Can someone on an iPhone go to that site and download games?
Or do they play them in-browser or something?
Iphones dont let installs from anywhere other than the app store as far as im aware. you will have to jailbreak your phone if you want to download from the web
oof so that's what it comes down to xD
I'm not sure how apple expects their devs to test on an iOS device when they limit so much like that
Is there some sort of "dev view" where you stick something on the app store but it's only available to your Apple ID? 🤔
yes thank you i get it
@austere swallow No need to upload an apk to some website or jailbreak your iphone
Build your game using Unity and directly install it from there for Android
And for iOS you will have to build the game as xcode project and than install it on your iphone using xcode
It's faster than uploading somewhere and downloading again on your phone
I don't have an android device lol
xcode 🤔
thanks for the tidbit, I'll look into that in the future
What OS are you going to develop the game for? @austere swallow ?
AndroidJavaClass intentClass = new AndroidJavaClass("android.content.Intend");
Guys, Why are we passing android.content.Intent as a parameter in constructor
Anybody know?
@robust hamlet oh you know what I saw this question yesterday and my phone was almost dead so I forgot about it. What exactly do you mean by OS? I’d like to get it on the Apple App Store and Google Play, so I guess Android + iOS?
Ok, so for iOS Unity can only generate Xcode project and for Android you can directly build an apk file or Android Studio Project
Plus iOS is $99 a year whereas Google play is $25 one time payment
Didn't know iOS was yearly. I'll look into that when that day comes :p
Again, I have an apple device so if I wanted to play my own game (which I very well may!) then I'd need to get it on iOS lol
And on the topic of mobile development and the way you build the game for different devices, is there any sort of OpenVR-like API for me to work with in Unity that would basically allow me to write code one time and would automatically translate the code I have that doesn't work across both types of devices into the necessary code to work on both devices?
Like, OpenVR allows me to write my code once using a set of abstracted input classes derived from OpenVR itself, then the code behind that API basically creates those input classes out of the different VR Devices based off of what it detects you're using
So I only need to program my game for one type of input, which OpenVR then automatically maps to the different possible devices a person may be using
Is there anything like that for mobile devices too?
OpenMobile? 🤔
Anyone know how to use gyroscope in a way that once the device has tilted 90 degrees it will then do something. In other words using an "if statement" if (phone tilts 90 degrees on x axis)
@austere swallow that's the whole point of using Unity, you write one code which runs on different devices
Keyword: Hybrid native
@robust hamlet o u right lol
Hi, does anyone here tried using BuildPipeline.GetBuildTargetGroup( BuildTarget.iOS ) to get the BuildTargetGroup of iOS?
it seems like it will return BuildTargetGroup.iPhone now, which is obsolete and I can't set the define symbol with this BuildTargetGroup
It would be great if anyone can tell me the correct way to get the BuildTargetGroup 🙂 thanks!
oh and I am using Unity 2019.2.0f1 🙂
Hi - getting this error when sending an intent to unity3d
"Permission Denial: starting Intent"
anyone know what permission i need to set in the manifest to fix this?
hello , if we are talking about android , is OnApplicationPause or OnApplicationQuit ? (Saving and Loading)
Guys, Do I need to have a payed developer account to get monetized from the google playstore
Guys I'm going to upload my first unity game to playstore. So do I need to integrate Google play sevices and Google mobile ads unity plugin to upload my game?
@true hearth Quit?
@hazy kiln you have to pay for an account to upload your products to store
And you dont have to include those services if im not wrong
@manic coyote Then how can I monetize from my game if I out that in Play store
Oh if you wanna monetize your game then you would need ads
okay
@hazy kiln Use admobs for inserting ads in your game to monetize it, also you need to pay a fee to upload to playstore (I think its a one time of 25$)
@velvet hare , If we are publishing our game as free version , then ads are the only way of monetizing right?
or selling items
Okay
@hazy kiln essentially yes, there is some payout I think over a lot of downloads, like 100 downloads is 1 cent, not sure, but it's really really low
Hey everyone, so I'm currently trying to add touch behavior, so when a user swipe up down left or right on an object, call a specific method.
Any idea where to get started?
Everything I find is pretty old and whatever is used is no longer in Unity documentation.
looks wank
I wouldnt install an APK like that. put it on google play for alpha testing and im sure you'll get testers
That looks Suspicious
Okay,@velvet hare
Hey, I'm doing a native iOS and Android integration with unity, using the unity as a library from 2019.3. The app is going to have localization so I need to pass language setting between native and unity module. To avoid writing bridge script and passing language parameter each time the native/unity module switches, is it possible to use player prefs for that?
Like, if I change the language from the native side, it will save the setting to shared prefs / ns user defaults
And if I change the language from the unity side, it will save to player prefs
And is actually player prefs == shared prefs == ns user defaults?
Can native modules read/write to the same file that player prefs from unity save to?
should i use x2 or x4 antialiasing?
Unity's canvas system is very reliable and it gives powerful configuration options. If something is rendering wrong here it is most possibly bad canvaas configuration and incorrect object placement
probably you are doing something wrong and that's why it's not working as it should be
What's not working?
@spice frigate you talking about the scale of the canvas on different device screens?
If so you can add a canvas scale component in the root canvas.
@chrome haven by reading how to do it
Choose which ad provider you will use and integrate it's SDK and that's all
@chrome haven right click> add new window> services tab>follow the instructions for add
Hi all, I am experiencing slow game loading time, when i start the game on my laptop with unity editor everything is good and the game load instantly since i have quite strong laptop but once i build the app and install it on my Android phone the loading time is approximately 10-14 seconds, I tried to disable all my code that runs on Awake and on Start or Update and the loading time is still the same. What would be the best way to track/debug the problem for this kind of thing?
put development build on the phone, then usb debug and attach the unity profiler to it ?
got it, didn't know i can attach that, thanks 🙂 will look it up!
@spice frigate which part is unclear for you?
I think I understand now
Requests is how many time the ads button has been pressed, and impressions is how many actual ads has been viewed by players
Not really
'Ad request
The game client makes an ad request to the Unity Ads network during SDK initialization. If an ad is available, the ad caches and the server tallies a received request. When a player views the cached ad, the game client sends a new request.'
'Impressions (see also, Ad start)
Impressions indicate the number of times an ad is fetched from the server, and tally every time a video begins playing. Impressions earn revenue, however, the quality of impressions vary (see section on interpreting the data, below).'
Unity Ads has pretty good documentation and explains everything, you should better check it first before asking a question
Yeah, I'd definitely recommend going through https://unityads.unity3d.com/help/resources/statistics as it breaks down a lot of the meanings of the dashboard.
Hi, calling GetPixels is crashing my game on Android.
I’ve been trying to debug this for at least a week, so I’ve gone through a lot of different methods to improve things, including visiting an empty scene to Resources.UnloadUsed as well as explicitly destroying Texture2D objects, calling System.GC(), waiting for GC to make up its mind, and so on.
I am forced to merge many textures together in order for this game to work. I cannot change this because it is a port of a Flash game (and Flash didn’t crash all the time when you tried to merge textures) we cannot redesign the game we’re trying to update and bring back to the store.
Are there outstanding issues with Texture2D? Is there a way I can allocate the arrays for Texture2D that won’t cause a crash? I’d appreciate any help - please bear in mind I have been back and forth with a number of devs for solutions. I’ve come here because I’ve completely ran out of options.
addendum: This morning I found out about System.GC.WaitForFinalizers. It seems to doing the job of clearing out the arrays that were allocated to make textures.
Still looking into other things I can do to partition memory, but I can load scenes without crashing now.
Does that kick in between scene changes? or can it be ran at any time during a scene?
Is HDRP usable for mobile games?
I have ads on my game, and have 50 impressions but the ad revenue is $0.00. I would of thought id of got a few pence by now?
Hi! I have a problem with Unity and the Facebook SDK.
I've logged in to Facebook with my app and then I make an AppRequest - a native FB dialog pops up asking me to log in again.
Anybody have any insight to this?
@spice frigate depends on the rates you have for eCPM
also most ad networks aggregate for such traffic especially because diff regions have diff eCPM
i saw on the forums that 1000 impressions net between $6-$12 so by now surely i should see atleast $0.50 right?
Im using the UnityAds SDK
depends on the deals that you have with your ad provider. they can go as low as < 1$ and as high as 130$
and for example u can have 6$ for impresions in the US, and like 0.15$ for impressions in kazakhstan or sth.
so value per impression is based on region viewed>?
this is what my portal looks like
and sometimes even per the ad that is being presented
theres only 30ish active installs currently, only just released
and i dont really know how to promote it other than paying for adverts in the AdMob network
sometimes u need to wait for the data to show up, because of how it is constructed
don't worry too much before u'll achive like 500 impressions
I dont think thats likely 😛 app store is very oversaturated
well. depends. the entire hyper casual thing is based solely on releasing semi-decent games stuffed with ads with UA costs lower than single ad impression
so companies run crazy UA on app stores for those users
I don't think any game works on organic traffic atm
(unless it alreeady has 1M+ downloads)
my game tags are ojnly 3 aswell, so i donmt think much traffic will come to it :
there is significant evidence of tags having really low impact on ASO
so wouldn't count on that
ASO?
appstore search optimization
basically what should your game name/subtitle/desc/tags be to be higher in the search results
So it doesnt matter all that much
So what is the best method to get more installs and more users
ive posted to my twitter facebook instagram and relevent reddit pages
Does it also work alot on the art style of the game and Icon displayed on google play?
Coz its this
no. I mean real user acquisition. like. u pay to a company like facebook, and for a certain price you get a guaranteed install of your game
icons and screenshots are only revelant for organic search/store browsing
so depends where you're focusing
so like user first needs to find your game, and only then screenshot and icon mattersa
I thought UA was just actual installs, or are you meaning the routes to go down to actually get UA
you can actually do AB test stuff like icons or screenshots performance on GP store
I mean that you pay (for example) facebook $ to show ads for your game. you set the budget to like 50$ and you will pay like 0.1$/install and you will only pay if the user will actually install your game
Oh that sounds interesting
https://www.youtube.com/watch?v=FvZNVQuLDjI
Is this system expensive for mobile?
Make amazing particle effects with the new Visual Effect Graph in Unity!
This video is sponsored by Unity.
More on VFX Graph: https://ole.unity.com/vfxgraph
● Go check out Line of Code: https://lineofcode.io
● Discord: http://discord.gg/brackeys
♥ Support Brackeys...
Its been 4 days and eCPM still has no data?
or does it only update per 1000 impressions
Hey yall. When I build and run my game on android, some TextMeshPro objects's text does not update. The objects are connected to a script via a public reference and will initialize the text input in the inspector; however, will not change their contents when changed in a script. After some Googling, I have tried using SetText(), manually setting the text member, force mesh updating, and deactivating, setting the text member, then reactivating to no avail. What is unusual, is that I have other TextMeshPro objects in the scene similarly referenced and updated (from script) without issues. I have no idea why it isn't working.
For reference, it works fine in the editor. It will update everything properly. If I build and run then the problem will arise.
@spice frigate it updates every day, from quite some time a few times a day. If there is no data that means there is no data. Your game has 10+ installs on Play Store, it's something pretty normal if you ask me.
Looks like I’m still in crisis mode - I thought I’d solved my memory management issues but all I’ve done is delay he inevitable crash:
Android is not garbage collecting.
I’m using 2019.2 but I have tried other Unity versions and they do the same thing. I am calling GC.Collect() to clear memory whilst waiting in an empty scene. On other platforms the memory is reclaimed.
ONLY on Android the memory usage increases. Sometimes it simply doubles. On windows or in the Editor the garbage collector works fine.
I’ve have been trying to fix this for over a week. I have read every memory management tutorial and everything I do simply delays when the game will crash. Can someone please tell me what is happening?
@last herald did you try to use Profiler to check maybe there are some allocations you could avoid?
What use is checking my allocations when one specific platform refuses to manage them?
I’ve already been profiling the memory for days. I discovered a leak with Texture2D which I fixed. I then started getting an out-of-memory crash when I attempt to get an array with Texture2D.GetPixels32.
this does not mean the error is caused by Texture2D. It is caused by allocating memory.
On Android the memory is never released. On Windows the memory is released. If I avoid allocations then how will that help? It will simply crash at a later point.
In fact I already tried to reduce allocations. It crashed at a later point.
maybe if you could post some example code showing the problem people might help or point to what may be failing
also on which Unity version are you @last herald ?
2019.2.4f1 - I’m building for console as well so jumping between versions costs me half a day fixing stuff.
The project is pretty large so I can’t post an isolated test case. I’m currently trying to reproduce the error on Android, but can’t find out what locks up garbage collection.
It is exceptionally hard for me to communicate any issues because I must wait 5 minutes with my computer unusable due to it compiling for Android. The issue only ever occurs on Android, not in the editor, not on Windows, not on iOS.
Do you change scenes at all or is it all one scene when it crashes?
if you stay on one scene a lot, you could try calling Resources.UnloadUnusedAssets() - this has fixed crashes on an android app for me in the past @last herald
infact i used it to basically cure the same problem you are having
worked on windows but not on android and only happened when i was showing and deleting a lot of images over time
Already tried that.
I just now tried a build on iOS. It works perfectly, I’ve even got it showing my current memory usage, which resets every time I reload the scene.
Inbetween scenes I go to an empty scene.
I call Resources.UnloadUnusedAssets.
I call System.GC.Collect
I call System.GC.WaitForFinalizers
I wait ten frames.
I wait ten more frames around EVERY memory management method.
I make sure all static variables are null.
It still crashes only on Android. Smart allocation will not fix this, it only delays the crash.
I have tried several other builds of Unity. It still crashes.
I’m now going to spend what might be the next few weeks stripping down a project. I don’t know what else to do.
try a different android device, might be specific to the model
Good point. Worth ruling out all of Android, or maybe just ARM7.
Okay this issue doesn’t occur on Android 9
I does occur on another Android 8.1 phone (we have a couple of Moto G5s in the office, one is my phone)
As an aside on memory management: A coworker came over to offer some advice on the subject. Then he looked at my code and saw how many systems I was already using to flush out the memory.
He laughed and said, I shouldn’t have to write code like that because it makes it unmaintainable.
@last herald may also worth trying Incremental GC option
@last herald As far as I understand it's causing OutOfMemoryError or?
@robust hamlet The phone crashes with a gsl out of memory error
@noble arch I’ve already tried incremental GC.
@last herald are you on il2cpp or mono?
I tried compiling with both, same error
Managing the memory of my project is not the solution.
It is like slapping a band aid on a severed limb, it’s still going to bleed to death.
This is definitely a bug, it only happens on Android 8.1, no other platforms affected.
Worth filling it then
When I have something to file. The project is 2gb. I still don’t know what the cause is.
The memory leaks when a scene is loaded, I’m beginning to suspect it’s something to do with ScriptableObject as I have several asset libraries split across the project that are normally unloaded.
I tried removing all sfx from the project and the memory leak went up slower. Still trying to create an isolated case. That’ll be my task today.
@last herald also maybe a newer Unity (and thus android player) have this bug fixed?
tried that already. I spent most of my week installing new Unities
That sucks
Im getting this error, everytime I try to build for Quest/Go
CommandInvokationFailure: Gradle build failed.
Help!
@last herald I would go with checking in detail what actually cause that issue in that Android version, probably some system stuff which are not working correctly on Android side and see if it's reported and etc. On Android (not really sure about Unity) you can't actually trigger garbage collector even if you call it. It may run, it may not , it really depends on 'his' mood
@robust hamlet Saying that you can’t trigger GC on Android is false, this problem exists only on 8.1. I can collect GC on Android 9. That means the GC not listening isn’t a generalised thing. I can also call GC on an empty project on Android 8.1 and I see an impact. I have read Stackoverflow posts saying that triggering the GC does nothing, these statements seem hyperbolic in the face of the evidence I have been gathering over the past week,
I don’t know where to look for reports of memory leaks on Android 8.1. Removing Unity from my investigation parameters does not narrow the search - instead it gives me hundreds of false positives.
Hey everyone how do i change the Input.Getbuttondown.(Fire1) to to touch instead of mouse and keyboard i have a Handle set up for it just cant get it to work
Use a button maybe
@spiral ledge A touch should register as a left mouse click by default
Like when i build the game and touch the screen it works but i just want to be able to press the button and my touch is left mouse click
Probably this is just a random and quite easy to fix bug but I'm currently building my first game and I have a bug which has been eating my soul for the past 7 hours.
After creating a character selection menu using PlayerPref (Which can be found here: https://pastebin.com/fQ5nYizw) the chosen character's (a car) controllers aren't working anymore. (RCC V3) It works when it is outside of the GameObject (which is using the character selection script) but not when it is inside.
What could be the problem?
Hi, I have a performance problem while dragging an object on the screen by finger, on 2D game for Android. The object I'm moving is just a small sprite 16x16 pixels in world space. The app sets transform.position on OnMouseDrag() events. In general it works but I have concerns regarding the performance. I don't mean frame drops but some lag between finger touch and the rectangle which is following the finger with a distance - rectangle is not always exactly below the finger, but has some distance depending on speed of movement. Please see this effect on video: https://youtu.be/AAY7sigJt24. App running on Samsung Galaxy S8. I tried lots of different things to improve this - update movement in FixedUpdate() insetad of OnMouseDrag(), use rigid Rigidbody2D.MovePosition() instead of transform.position, Forward and Legacy Vertex Lit rendering paths, using IPointerDownHandler, IDragHandler instead of OnMouseDrag(), move on Canvas instead of world space, move camera (using ProCamera2D) instead of moving object itself, but nothing helps - the lag is still the same. Here is the whole code: https://gist.github.com/kbogucki/72d3e3abebb587fe7678ee7a06eb0108. I can share the example app if you want to try it out. Do you know if there is some other way to do such movement with better performance? Thanks in advance for any help.
There is a problem that keeps happening when I try to put something on mobile. It say my cursor texture is invalid? I have been looking in the textures and can’t find anything about a cursor
on mobile you dont have a cursor, unless you're making one? @dusky harness
I am making something to put on mobile @spice frigate
I just got done making my game and setting everything up to get it on the iOS App Store, but when I had finished with building it I was told there was an invalid texture for cursor but I could find no reference to a cursor anywhere. @spice frigate
its in player settings
and i hope you know ios is quite difficult to get an app published
Not to mention expensive
@dusky harness
@sweet mason It's not something with your code, it's a general problem with mobile devices at all. That's normal to have some delay when moving your finger faster
@robust hamlet Thank you for your response. Anyway I'm wondering how this is implemented in other games available in Google Play, since there are some games without such issue. Maybe this problem is Unity specific?
Mostly it's display responsiveness, but keep in mind the implementation in Unity is tied to your game's fps
If it runs on 30 fps let's say, your 'dragging' will be 'lagging' because you have 30 frames per second to calculate the movement and etc
More fps, more smoother movements. Another thing to keep in mind that Unity by default set the fps on mobile devices to 30
I will check it, thanks.