#📱┃mobile
1 messages · Page 42 of 1
You can connect it. Of course you can't modify it - you'll need to rebuild. But I don't see how that would be possible with android studio.
And while in-game debug tools are useful, you should always use the profiler to troubleshoot performance issues.
That's why you **connect **the profiler to the device.🤦♂️
I'm not sure what you mean by permission...
Well, don't rebuild every time. Also, there are ways to reduce the build time.
No lol
you can connect the unity profiler and the console to the device and receive data from the build.
It's unrelated to logcat. You don't need it installed even
in packages
If you mean that you need and Android SDK for that, then sure, you do.
You wouldn't be able to build the app without it though, so you have bigger problem than profiling.
No it doesn't. At least it shouldn't. There're other options that affect build time too: Whether it's a mono or IL2CPP build, compression options, etc.
If you want to troubleshoot build times, you should look at the build report and see what takes the longest time during the build. Then you can think of ways to reduce it.
My game builds in around 5-10 minutes(with all the heavy settings) and it's good enough. I only test on the device before submitting the next release, so once per week-month.
Afaik texture compression doesn't happen during the build time.🤔
Maybe if you don't have compression settings on your texture assets, it will...
Ah. We only use a limited number of mobile friendly shaders, so they compile pretty fast.
I see. We don't bake lights mainly to keep the build size as small as possible. And no fancy shaders to keep the performance up on low end devices.
How are you doing it though? Exporting the project to android studio?
does it not need to rebuild stuff anyway?
Anyone?
can some one help me to modify the code for move 2d player rotation by dragging on screen ?
this is the code
When I create my build for Android, Unity tells me I'm using OnMouse...() events. Is there a huge difference between performance of OnMouse.. and touch?
#854851968446365696
Use an online code pasting service
My APK for my android build is 900mb (350mb for desktop version). The largest file is data.unity3d in assets/bin/data. How do I see what is causing this massive size? And how can I go about reducing this?
Click on Open Editor Log. Gives a detailed breakdown of everything, including where the data is going.
What am I searching for in this to see what the issue is?
Its 350mb on desktop, much of that is image files so kind of.
I'm trying to work out a second issue if any of you have some suggestions:
On Async load scene my android app just crashes, no error messages just a crash and all messages stop coming through in Android Device Montior. I'm using API level 28 on a android version 9.
Any suggestions on how to debug what is causing the issue? It loads the first menu fine, but on scene change crash.
@quartz frost as well, Thanks for those, the reason was all my 1024x1024 images became 4mb instead of .3 mb because they are all uncompressed. I'll reduce them all for the android build and see if it helps
A crush without error is often related to insufficient memory. In other words, your game uses too much memory.
It probably is due to your images being not compressed.
Yeah seems like it, and I've been going through reading about profiling etc. But what you mean by images not compressed?
But yeah, after a build open your editor log file and search for the latest "build report" it should show what assets take most space in the build.
You should specify compression in the texture import settings.
For each texture you're using.
Yeah I did that, and reduced my build size to 500mb but can't go smaller really without impacting quality. (though I might have to) - This still may be like 100 1mb textures having to be loaded at once, and I assumed that the import settings already have them compressed?
What do you see in the build report?
im in a build let me cancel it check my settings
Its still al my images and textures which were 4.5mb each now 1mb-300kb each
like 400 of them
Is this not correct for android?
The biggest texture in my project is around 2 mb and it's a texture atlass used by most models in my game. Overall textures take less than 20mb in my build report.
Read the warning.
It tells you that it can't be compessed and why.
Textures should power of 2 most of the time.
If I have a card game, where the cards can be zoomed and I have 100 cards with 2+ images each so need to be atleast 600 px accross and they are not square images how would I go about this?
To make them square I would need to add blank pixels on the side
? why would you do that?
Because you should optimize your assets.
ok one sec, what do you mean by stretch/crop
You have to figure a way to make use of optimized assets.
do you happen to know a guide or something for this?
Stretch would occur if your texture is 512*1024 and you're trying to make it display with a wider aspect ratio.
I don't think there's any tutorial on that. It's just kinda common knowledge thing.🤔
Having android builds only work if you set all your non-square textures to square and them stretching them in the scene display is kinda a big deal and completely non-intuitive, there must be tones of Q on this from new people to android development
im trying to look for someguide or something now
Alright, I can't seem to find anything with best practice for compression when showing non-square images. But I guess I can just stretch them?
Compression is something that is hardware dependent, so there's nothing you can do about those rules. You either use a compression method that is compatible with non pot textures and bigger size, or adjust your assets to use the better compression method.
Sure, you can.
What do you do when you want to show a non-square image?
it doesn't have to be squared
512*1024 is pot too
256 1024
etc
well one that is notthat dimention
say you have a card. Cards are never that dimention
how would you go about that?
well there is a bg and an image both are fairly strict to be a non 1:2 ratio
and it must be done, slay the spire and hearthstone all have full card borders
I'd use the same frame for all the cards. If it's 1 uncompressed texture, that's fine
Ok thats fine but then the card art?
Also there are compression methods that don't require pot
Looking at yu gi oh cards for example, their art seems to be a square image
Or very close to it
Well, my worst-case method atm is just stretching the images, but wondering if there is some best practice way to deal with this.
cropping is also an option
can't do that because it would cut important art
have a pot image that is bigger than the displayed part and crop it so that only the desired part is visible
I was not aware unity can crop?
This is the cards atm
it doesn't you do it yourself. If you're using a mask of the image, for example.
ok so maybe I can add whitespace beyond the edges and then mask it?
hmm
guess I'd have to do that then
ty btw
Hey dlich, how do you handle accessing images on android?
For desktop, I was loading all my images from the resource folder as sprites and saving them into a dictionary to access when needed. Wouldn't this save all of those images into ram though? Should I be loading them from resources whenever I'm accessing them and not pre-load sprites?
Afaik, they're loaded as soon as they're referenced anywhere in your code. You don't really have a way to prevent that. So instead of messing with resources and stuff, just make it more convenient. For example, make scriptable objects card data that hold reference to the right image.
Did you check your build report? How much space do the textures take overall?
Yeah, I got it down to 288mb, textures are still the majority but don't think I can bring it down without affecting quality. If im still having issues I'll try though
Take a screenshot from the top of your build report.
Will have to do it in a sec got a crash when profiling editor restarting now
But the game still crashes on android on scene change, and really struggling with getting the profiler to work with the app.
What device do you have? Some older devices don't work very well with the profiler.
Samsung S8+
Hmmm... What profiler modules do you have open?
all of them I guess?
Disable those that you're not using
They're imposing additional overhead.
sure, the issue though, is when I try to connect here:
And GPU module can cause profiler problems on mobile devices.
Manual connection doesn't work and adb forward tcp:54999 localabstract:Unity-com.BiggerWorldsGames.CosmosInfinity
doesn't work either
same with a range of ports
this is USB debugging
You don't have a too heavy loop at startup of that scene?
Possibly, without the profiler its really hard to see whats going on, I assume I should just be checking what its doing before it crashes?
In command line logcat the last thing I get is: [Singleton] An instance of SceneLoaderAsync is needed in the scene, so '(singleton) SceneLoaderAsync (UnityEngine.GameObject)' was created with DontDestroyOnLoad.
So it just crashes after trying to load the scene. However, in Android device manager It seems to start with the start methods of all the scenes menus, seems to crash when loading settings menu so maybe I can investigate that, its hard there though because when it crashes all the unity logs disapear from it XD
Does that happen every time?
Yes
manually connecting gives me "connection refused" no matter the ip combinations too
Try disabling all modules but the CPU, then reconnect your device to the USB and try to connect the profiler again.
unplugging device does not remove the AndoirPlayer option in profiler, it still stays there.
Plugging it back in does not change the options either, and clicking on it still gives the same error. I will try re-start unity without it plugged in then plug in and start game when unity is open again
Yeah, it could be just a connection bug
Just to make sure: you have developer mode enabled on your device, right?
When re-starting I still have the same options in connection even without anything plugged in
and yes
as if an option for android player. Maybe I'll try restart my PC
Actually I think that's normal. I have it too, despite my device not being connected.
@tribal ledge you try to connect to a development build, right?
I have Development build, Autoconnect Profiler and Deep Profiling Support turned on here. Have never had to adjust anything with the Profiler itself after Build and Run
Anyone have an issue after adding Google play services to an android build with the game crashing immediately on the device? Everything worked beforw
see if there are any errors in the log
I'm trying to follow instruction online on how to get logcat in android studio. Not seeing it though
Get the unity package
Which package?
Android logcat got it. Thanks
2021/10/17 09:34:42.626 2345 2345 Error libprocessgroup set_timerslack_ns write failed: Operation not permitted
Only Error
nvm
What is the best way to paste my logcat here?
Use a bin. #854851968446365696
?
Try building non IL2CPP debug build. Because the stacktrace is unreadable.
Thought all android apps had to be arm64?
arm64 is unrelated
was it set to mono when you got that log?
Well try to get a log with mono
and change the build config type to debug
Ah, that setting is probably disabled in a mono build, so ignore that.
I dont reall know how to do that.
Yes, of course. There's no point in a log of a properly working game, is there?😅
Could my NDK version be out of whack
There's anot column to the right(I think). You should select it to filter errors only. There's a lot of useless noise info.
Probably not. Your game wouldn't build if that was the case.
OK, I am building it right now with IL2CPP and arm64 checked
Why is that worthless? That is when the game is crashing immediately, The game is working 100% correct with mono, there is no crash
I see
This is the log with unity tag on the IL2CPP build
last link is the no tag error only
As I said, the stack trace is unreadable. Try changing the build type to debug at least. It's currently Build type 'Release'
I think it's the compiler configuration setting in the player settings.
Only PLace I see to change is under publisihing settings minify
Take a screenshot of your player settings
I found how to change it to debug
it was c++ compiler
That is a the logcat in debug
nvm still says release
So I finally got it to build with il2cc and arm64, I had to turn off arm7(32)
Really strange.
So if both boxes are checked it crashes, really odd, does good still require the 32bit and 64bit
@static plume well Google requires a 64bit.....you can use only 64bit and they're accept it
Yeah, thats what I did, just odd, it wwas working then it wasnt
Reasons why it's advisable to use both 64 and 32 bit is because some devices are 32 bit devices
So if you build for only 64 bit, the game won't run in a 32bit device
I have seen others that have had the issue
most devices in the last 3-5 years are 32 bit right? This is my first published game or app, I have been working on it for about 6 months. I am ready to publish it and move on to bigger and better things.
Take my new knowledge with me
most devices in the last 3-5 years are 32 bit right? This is my first published game or app, I have been working on it for about 6 months. I am ready to publish it and move on to bigger and better things.
@static plume yeah
The ultimate goal is to successfully finish a game
The more you finish developing a game the more the experience you get
Yes, very excited about it, did not anticipate the google publishing to be such a PITA.
Now that it is lesting publish for internal, I just need to set up the leaderboards and achievments. I have everything done on google cloud. Just need to attach it to gui I assume
Yes, very excited about it, did not anticipate the google publishing to be such a PITA.
@static plume lol
Now that it is lesting publish for internal, I just need to set up the leaderboards and achievments. I have everything done on google cloud. Just need to attach it to gui I assume
@static plume yep
Like me, my next move is to use a custom Leaderboard and achievements
I want people to be able to use custom name rather than their Gmail for Leaderboards
Gotcha
So finally got it working just following this tutorial: https://www.youtube.com/watch?v=iCXwaehzRFQ and now I have my profiling. Could the issue be memory though? it only goes to 118MB before it crashes. It seems like its something else. (unless 118mb is too much for Samsung S8? according to ram usage it used 208mb max, which is less than my free ram of 1.3gb)
Seems like its something else thats randomly crashing it
Yeah, should be something else then. You said that there's no error, but did you actually check the logs?
Which logs specifically? For unity there is nothing, it just stops.
The general android logs are hard to follow because when it crashes there are suddenly like 1000 messages. Is there a good way to narrow down the android logs?
ATM I'm going to try and debug through VS and just step through the whole awake sequence.
Are you using logcat?
Yes I was,
Then you should filter by Unity tag to hide unrelated messages.
Yeah so doing that there isnothing
Let me do it again make sure
Take a screenshot of your entire logcat window. Maybe there's some other problem with it
Commandline logcat. It crashes at this point and no more messages
Same for the android device monitor, but at this point in the device monitor the "all messages" baloons to 1000+ messages each second and then the unity logs are wiped in the UI (probably because too many messages)
Did you try using the unity logcat package?
It's a package for unity that shows the logcat and allows to configure it in different ways.
ok ill get that and try it I guess
I'm not sure if that'll change something. But I'm more familiar with it. And it includes some additional info.
mk ill install it see what it says
kk, um how to do filters for unity with it?
just search unity?
No. Right click the tags column
just randomly ends
Select your app in the filters:
Yes
yep its verbose
Hmmm
.>
Okay. What if you disable the unity filter(tag) and scroll to around where the crash happens?
Interesting, in the profiler the CPU didn't spike though...
or maybe it did, but it looks like after the crash
Hmmm
The last message suggests that your game was doing something heavy on app start.
are you doing something heavy on awake/start?
Scene start, the only things I can think off is starting like 10 tweens to close the menus, loading textures for menu icons and items etc
All just UI things, most of the heavy loading is done before the scene change when data is loaded which completes before scene change and passes fine with no crash
Wait, so when does the crash happen?
Game start -> login scene -> login -> loads from Playfab data -> scene change when loading is done -> Awake on at least the settings menu is completed -> crash any time between this and before menu is displayed
And when you profiled the memory usage, at what point of the game was it?
Thats CPU and Memory when it crashes at the end there
what do you mean by what point though? how can I see more detail on where I am up to in the code here?
What are the blue spikes?
Looks like playfab communication
With the memory module you can take sample of the memory in the current frame
But it shouldn't be too much different from the graph. Just showing more details.
Sure yeah I did that but not sure how that can help.
I won't be able to find what is causing the crash just what isn't I guess
Yeah, I don't think that's the issue
I feel like it's something with playfab or the way you use it
Possibly, maybe I can do some research on that, but without seeing any error messages this gets really difficult >.>
I've no clue about playfab, but the spikes seem a little suspicious. taking 50 ms to parse the data feels like to long.
What kind of data do you load with playfab?
Everything intensive is already loaded on login, so I doubt its that, those spikes are just the standard heartbeat checking for active login I think?
Not somethign I do
mm Can't seem to find anything from cursory google searched, maybe I'll post a forum Q, but either way I don't think its related to the crashes, its not happening during one.
Still any suggestions on methods of narrowing this down? Should I just add debug messages to all the start methods in the main menu see where it stops?
yeah, I can't think of anything aside form more debugs.
The only time I encountered a crash without any errors is when I was running out of memory, but it doesn't seem to be the case for you.
Looks like deep profiler saved me. If I go into the hierarchy I see exactly what function is taking so long! Phew! time to see why it is. TY for all the help
Donno if you know this, but it's way more convenient to navigate the profiler in hierarchy mode
I didn't, just found it now and seems to be my solution
Any idea how to close my Unity game when using Unity as a Library? Application.Quit() closes the parent app too, which is undesirable.
has anyone tried firebase authentication for Logins and SignUp? My project requires facebook,apple and google account for authentication. Just not sure where to start
Firebase has pretty good documentation
Any idea how to see what sprite meshes are causing the issue?
could try selecting affected objects in the details, but the chances are it's not gonna show much.
more importantly, what's the method that's getting called?
can you expand the column a bit?
aah, I see it in the top right now.
What do you do in MenuManager.OnEnable?
A few things but nothing that seems to want to trigger sprite tracing, other than in the LoadCardDatabase, but I would see it inside that function then right?
It could be in the load card database, I am loading 2D textures and converting them to sprites. but again it should appear under that function then. I;ll try that anyway
Not necessarily. Non deep profiler has a limit of how deep it could go.
That could be the case
How do I go deep in play mode then? its deep in play settings.
Doesn't seem to be enabled on your previous screenshot
Cool! will try that again thanks
Who else is currently making a squid game remake?
does anyone know how to schedule notifications? Like for example, make a notification pop up every Monday 8PM?
Any idea why this could be happening?
It means that Initializer.Awake is doing some heavy stuff.
Yep, I finally got it working by splitting up the things it loads for the main menu, no idea why its taking so much processing power though...
Can't say anything specific without seeing the code.
It could also be that this method is called over many times. The method above it is at least. Over 3000 times.
It looks like its the visuals
unity has this Mobile Notification package
as in when its trying to draw the assets it doesn't seem to be any of my code specifically
What's "Initializer"? is it your script?
It is a script which initializes things, but in the main menu it littlerally does nothing (I checked with the debugger)
Like doesn't go into any of the ifs, I am pretty sure its not that
I anyway dissabledit no change
And it still appears in the profiler?
oh no but somethign else has that time then
What is it?
let me re-start and check
Heh, funnily enough, that prompts Unity to warn that I'm not using a recommended JDK like... that's literally the recommended one, the one installed alongside Unity.
At any rate, that's fine and all, but is there a way to get them to work together without having to go in manually and do this for every project?
Yeah so no initializer, the CPU is really down- What I think was causing it actally the animations. For some reason all my animations spike the CPU really badly. And when I was loading the main menu I had a bunch of animations at the same time
That would mean that Initializer triggers them.
Menu manager triggers them, initializer was remoed when it was still doing it. - I recon it was because initializer was the last awake, and the profiler didn't record the animation because it does so after completing the animation so it all went under the last awake call
Sounds weird, but if you figured it out then whatever.👍
What kind of animation is that?
I am using dotween
The one which is intensive atm though, Is I am animating by moving anchor points, maybe thats why I can check that
Anyone thinnk they might be able to help me get my unity to allow me to build on android, i have installed the SDK and such but get an error for "graddle"
Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.
I have uninstalled this and installed a lower version, 26 as thats the lowest unity will allow
you need to install the specific one you are using.
Install 30.
Yes, and in build settings when you build you need to select the same oneas you ahve installed
31 is unstable on unity yet
Also Dilch
Looks like its text for some reason, constantly being re-drawn
When im animating
I dont have it installed, thats what it intially installed, i have 26 and a few lower ones now
So install it
i had it installed first, and it didnt work
as you see its not installed in the SDK manager
Yeah, canvas mesh is rebuilt every time. Are you changing a lot of text in the same frame?
I'm not sure if the initial problem was related to sdk in the first place.
And as I said, you want 30 installed, not 31.
oh i had it installed with a good few others down to like kitkat
ok i will install 30 again and see what happens
what would you think the problem is if its not the SDK? I am getting "gradle" error
Need to see more of the error details. And probably google them too.
Ok just a moment let me try to install this 30 again and do a build and i will post them, i couldnt find a proper answer for myself on google
not really, There are a few things which get loaded and edit text but all in one frame and non on the animation. Will have to look into it more..
Starting a Gradle Daemon, 1 incompatible and 6 stopped Daemons could not be reused, use --status for details
Configure project :launcher
WARNING: The option setting 'android.enableR8=true' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
Half of it is also probably due to the deep profiler. Check it with deep profiling disabled.
i got to potty, and pull some hair out 😛
you're still using 31 for the build...
is there another place i should set it besides here? also using unity 2020 lts version
Hmmm... check the path of the sdk in your preferences. Go into the folder and see what versions you have installed there.
oh ok your right it is showing that 31 is still in the folder.. but none of the others i downloaded to that directory are
let me see if i can find out where they downloaded right fast
hmm i dont see any other installs.. let me restart.. maybe i need to restart with each install
Anyone having issues with SDK
Download Android SDK Platforms 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 7, 8, 9, 2, 3, 4, 5, 6,
Download Android version 31
Then after download, extract the zip and move/copy it to the Unity path where the SDK is stored
Are you installing it via the android studio?
That's how I solved my issue with sdk
yes
Yeah they are not in there, the 31 is but its not supposed to be installed
trying this method above right fast
Yeah this dont work above
so it automatcally installs 31, i found the other installs but if i remove 31 it instantly fails without trying to build saying it cant find the tools, and i have it set to the directory
take a screenshot of your external tools with the path visible
Afaik this happens once per editor version.
While you're at it, just re-enable the switch. The SDK doesn't care about Unity's defaults, just the manually assigned field. Let Unity not complain about its JDK path by making Unity see the correct path.
Should probably uninstall 31 as well
i did before so i actually got it to work by copying the 30 from unity folder to the studio SDK folder
allot of data wasted >_<
So, after all that, it looks like the final culprit was all my TextMeshPro texts. Having underlays and outlines really really hurts, so much that it crashes the app. My scripts were fine (although I made them more efficient anyway XD, atleast something good came out of this) but each time the TMP texts wanted to render like 20 texts it would just destroy the CPU
Gonna ask since I can't find much info online for this.
I am loading 100 cards with 7 TMP objects on them each (this looks like the 680 OnPreRenderCanvas).
- Why do I get 9k TMP.GenerateText
- Even with all the TMP objects having no shadow, this is still a ridiculous amount of CPU time. Any thoughts on this? Can you just not have TMP on android? Do I really need to make a separate android build where all the texts are normal text objects? Or is there some other workaround here?
Anyone use ASO when publishing to play store?
Tmp are fine on Android. Although the number that you have is a bit too much. Are all 100 cards gonna be visible on the screen at the same time? Also, tmp shouldn't produce that many callbacks every frame, unless there are changes to the displayed text.
When I am creating this for the first time, I am creating and setting the values for each card.
They are all displayed in a scroll-rect together but you can only see about ~20 cards at a time.
I'd do pooling then.
I have to create them anyway on scene start and I don't delete them until I leave the scene, so how would pooling help here?
But any idea why there are so many text calls? What I am doing is:
For each card doing: cardList[i].DisplayCard(cardname);
And in the DisplayCard function setting all 7 texts to whatever they need to be.
No idea why its making so many calls..?
Hmmm... It could reduce the memory consumption. But if that's not an issue, I guess you can ignore that.
Don't you do it only once at start?
Yeah, pooling doesn't do anything for me here, its the TMP being updated. But why does it take so much time?
yeah exactly
It is done once
when I open the deck editor but still, its done once
But they keep on updating?
No
Its just that once
but it takes 10 seconds
to do them all
you can't wait 10 seconds whenever you open a new menu for the first time
Well, I'm not sure about that behavior of TMP. Try googling it maybe..?
couldn't find anything hence asking here, but ill try research some more
Does it take as much time without deep profiler?
Haven't tried that yet, I'll do that but the profiler shows up on the hierarchy (or maybe it was in the memory section I saw it?) so don't think its that. But ill build and try that now
What you could do is disable the cards before setting their texts, so it doesn't update their meshes immediately.
Are you able to instantiate without setting to active? If not I'll probably pre-populate them in editor and as you said update and then set them all to active together.
cool ill see if that helps thanks
I'm not sure if you can instantiate them inactive(I think you can), but even if not, you could deactivate them after instantiation but before setting the text.
I can try, but pre-populating them probably is better anyway
You mean in the prefab?
I mean, I would fill the editor with default cards, so I don't instancitae them at all just edit them and set to active
Without the profiler, the first time I opened that slider it crashed. The second time (When I re-start the app) it took 1~2 seconds and that's what it is doing from now on still. How is this possible? Does android do some sort of caching to make this faster???
Without the profiler I still get intermittent crashes, when I touch the screen while its loading
Yeah just crashed again on loading the cards no screen touching
.> hmm
I don't think so. Something was probably different with the state of your game. Maybe you're saving/loading some data between sessions, that could have an effect on it.
can't be, only way I could do that would be through player prefs and I don't do anything for that in these steps
Then no clue.🤷♂️
getting random crashes though is really not good. I'm using api 28 though, maybe ill try with 29 see if it changes anything
I’ll check it out, thanks!
Vector3 direction;
float speed;
//
while ((direction - transform.position).sqrMagnitude > Mathf.Epsilon){
transform.position = Vector3.MoveTowards(transform.position, direction, speed * Time.fixedDeltaTime);
//must always return data
yield return null;
}
I have this while loop with a MoveTowards to move the player to a certain position and it works as intended while testing it on the PC but when I build an APK and try it on my phone the movement is very slow, somewhere around half the speed I would get on my PC and I don't get why
Has anyone tried making plugins for unity?
you doing that in update or in fixed update?
Actually, you are yeild returning, that happens in update right? wouldn't that mean you should use Time.deltaTime not fixedDeltaTime? it would be different depending on framerte otherwise
How can you receive the event of using the back button or swipe back from, for example, android devices? To make that as another way to go back to home menu?
That's great 👌🏻. Thanks
I'm yielding null because the while loop is inside an IEnumerator
and yes, the StartCoroutine is inside an Update()
I guess I'll try changing it to a FixedUpdate and if that doesn't work I'll move the speed float from 1.5f to 3
FixedUpdate kinda solved it but it still feels slow so I'll *2 the speed
who knows that mobile game called Will it crush?
i want to make a way better version of the game without ads
@silent wharf you mean this? https://play.google.com/store/apps/details?id=com.dimchi.crush
hmm, yes. i am apro.
Pretty please, just do some tutorials. What you're doing is completely wrong and it seems like you don't understand what you're doing.
A coroutine that yields with null would update in regular update, yet you're using fixed delta time for your movement...
And starting a coroutine for movement in update/fixedUpdate is probably a wrong decision as well.
As dilch said, you shouldn't really be using coroutines for movement, better just do the operation in update/fixed update.
For the previous thing, you misunderstood what I meant: Yeild return gets called each frame. That is at the speed of "update" not "fixedupdate". It doesn't matter where you call it, you should be using time.deltaTime inside a coroutine to tell how much time has passed from each call but I am not sure if that is even a good idea anyway; just use update/fixedupate and the corresponding delta time. (Have a bool which is like "am moving" which can be switched on/off if its moving).
For this you should read the whole documentation on coroutines in C#/unity, there will be more gotcha's like this in the future which you can learn about easily through the documentation
Also @iron acorn Finally solved this for good! FYI: https://forum.unity.com/threads/tmp-textmeshpro-massive-cpu-time-for-tmp-generatetext-on-android.1185193/ -> https://forum.unity.com/threads/textmeshpro-precull-dorebuilds-performance.762968/#post-5083490
Its autosize + layout group is incredibly inefficient. Recommendation is to not auto-size but to have a controller which autosizes one text and then copies manually the found size to all other texts of the same size or something of that sort.
The whole time it was cos i had many auto-sizes in a layout group XD
I see. Good to know that you handled it!
You're making an assumption based on lack of complete information
To get complete information, do some tutorials/courses/unity learn pathways.
you're not picking up what I'm saying but ok, thanks
Ah, misread that. I'm making assumptions? Perhaps. If that's the case, then provide more information.
Hey guys, i am wondering if anyone ever tried to check if the silent (Physical side button) on the iOS device is on/off. Tried to find solutions but they all say that there is no native iOS API that allows to check for that.
So if anyone ever got any solutions i'm all ears 😄 Thanks for the attention
Interesting read from the Epic v Apple case
These massive companies get 70% of their money from less than 10% of their users.
I've always wanted to make a game that everyone would enjoy over focusing on that small 10% group. Maybe the idea for being profitable is by making a game that targets that 10% demographic. The "whales." It makes total sense that companies in the gambling industry are shifting to making games like this. Raid: Shadow Legends for instance was made by Aristocrat, a gambling giant company.
I set up admob in my unity android game, I have a internal testing in google play console, the ads with the test codes was working properly, I changed out the test ad codes for my adunit codes in admob, I am still gtting the test ad, is this normal until I publish it?
I thought it should send an no fill error
yeah i want to make a better newer version of it that dosnt involve alot of ads if not none
Hello
Pls I need someone to explain how unity ads net 60 days works
Is it that we get paid after every 60 days(2 months)??
Hello, i have published a game to play store 1 year ago or so (Mutant Slayer) I have checked everything and the game seems to run very well on most android phones but for some reason some people cant play it (leaving a bad review saying it), if someone could help with this problem it would be greatly appreciated, thanks.
Maybe, you should change Advertisement.Initialize("Example", false);
hello, i was wondering if i make a google play developer account can people see my real name?
i know theres a developer name i can add to it but can people see my actual full name as well?
Do you guys happen to know what is accounted for this pink system section?
Hello. I am about to start developing a new game for Android. what version of unity 2020 or 2021 would you suggest to use and what would be the reasons?
Either will work. Reason is, either will work.
Not very helpfull
Hello. I am about to start developing a new game for Android. what version of unity 2020 or 2021 would you suggest to use and what would be the reasons?
@runic hornet 2021 and the reason is the newer the version the latest things it supports
But if it's a trade-off, like newer features but worse performance and stability (bugs) ?
But if it's a trade-off, like newer features but worse performance and stability (bugs) ?
@runic hornet don't worry about it.... That's why you should always use the finished version
Mkay
What would u suggest for template? The "mobile" one, or URP?
I guess URP is latest trend
What would u suggest for template? The "mobile" one, or URP?
@runic hornet default
I'd recommend using the default pipeline for mobile
But it's clearly up to you and what you're planning to make
You suggestion is based on...?
You suggestion is based on...?
@runic hornet mobile Optimization
But like I said....it's based on you
i have google admob set up and the test ads work great in the Unity editor, but they don't show up at all on android devices, does anyone know why?
i have google admob set up and the test ads work great in the Unity editor, but they don't show up at all on android devices, does anyone know why?
@heavy crypt well admob ads won't show when they've not yet reviewed your app on the store(app store or play store)
According to their new system, your app needs to be valid in the store and they'll Review it and after reviewing, ads will start showing
Or you can check out what the issue is here: https://support.google.com/admob/answer/9469204?hl=en maybe you need to Wait for 24 hrs
Use the following guide to understand common reasons why apps show few or no ads. If you’re still having issues, use the Can’t see ads troubleshooter or check out the
how to download ndk version 19.0.5232133
@timid heart download this one
Then after downloading and unzipping it, rename it to "NDK" and inside, you'll see something called "Source properties", edit it and set the Value to 19.0.5232133 (which is the one for the Unity version you're using)
Is it possible to see a runtime console on game screen in iOS build?
URP is the typical renderer for mobile no?
You talking like Debug.Log?
I need error and debug logs both. A console logging everything within build just like unity's console would help.
Drop in a Text gameobject with a black background and direct your errors to that
or maybe a scrollable text object
You get this in XCode if you run through that
Well my game is working fine on my devices but its stuck on loading for apple review team so I needed that for them. Although I found an asset for that purpose
Whats the easiest CI/CD setup for Unity projects (For deploying to appstore and google play)?
Whats the easiest CI/CD setup for Unity projects (For deploying to appstore and google play)?
@sharp lion pls can I ask what's CI/CD?
Its for automating builds to publish automatically
Its for automating builds to publish automatically
@sharp lion well that is based on the store(play store or app store) not unity
Just wanted to know if there are any existing solutions as the builds need to be created from Unity.
thank you for the info 😄
im sorry to keep asking about ads but this is super new to me, i read that I have to ask for consent from EU players to see ads (or maybe i'm misunderstanding), do I have to personally add a yes/no button in game?
You are misunderstanding
If you (or the ad provider) collect personal data to show personalized ads, you need to ask permission for that or a way to opt out
but you don't need a permission to show ads, unfortunately
guys my 2d game is dying in rendering sense
Just wanted to know if there are any existing solutions as the builds need to be created from Unity.
@sharp lion you can build from unity
And manually publish it to the store
Yes, but want to avoid manual step as there are many apps to deploy.
Yes, but want to avoid manual step as there are many apps to deploy.
@sharp lion sorry mate... That's the only possible way to do it
That's obviously BS
few hours ago you didn't even know what CI/CD is
Unity even sells their own product for it
That's obviously BS
@analog plover what's BS?
Pls you guys should chat in full
Not everyone gets the abbreviations
Let's just say it means that you're mistaken
Let's just say it means that you're mistaken
@analog plover for what?
About the thing I replied to
About the thing I replied to
@analog plover about what?
Hello everyone,i want to ask something ,how to make outer glow or neon effect for unity mobile games without post processing or image effect? thanks
Is it possible to use shader graph with mobile ios/android?
Hello, I'm working on an Android project with Unity 2021.1. I'm trying to show the status bar all the time to avoid front camera hiding some of my UI, but I found that PlayerSettings.statusBarHidden is not supported on Android, is there a work around to do it ? Thank you for your time 🙂
The easiest way is to use unity cloud build I guess, link it with unity collabs or git, then upload & publish using fastlane(?). Havent tried any of those though
you can use the algorithm from shell based outline shader, repeat them several time with increased offset and decreased alpha
any idea why I would get SDK missing problem ?
2020 LTS
doing this... but not actually hopeful
@rain plank is your SDK setup correctly?
@latent violet yeah. As weird as it might sound, i moved the installed sdk and all other stuffs around it from unitys sub folder to Program Files/Android ... And now it works for some reason
This satisfaction messages from this window are basically meaningless...
He dis say without shaders...
No, he said without post processing or image effect
I can't add modules to my Unity editor. What's happening?
Does you install the editor via the hub?
Yes. Today I just launched Unity hub and I saw that under the version of my editor wasn't the icon of Android and I clicked to the three points and it just say: Show in folder and Remove from Hub
Hmm... That usually happens if you install it externally.
In addition my editor wasn't in the hub I had to put in from the explorer
What do you mean?
That's exactly what I meant.
@sturdy oracle I'd try closing and re-opening the Unity Hub or rebooting the system. If this doesn't fix it, maybe try reinstall your version through the Hub, selecting the Android module during the installation process.
I did it but it doesnt work so that's my last chance
If you had to do it, means that you either installed the editor separately or it was somehow unlinked from the hub. Try reinstalling it.
Via the hub
Let me explain. I just turn on my laptop, launched Unity Hub and I saw that the editor wasn't there
So I looked for that in the documents and add it again again
But when I opened the editor my code or input didn't work so I had to do a new project and do it again. Android module is avaible again but I can't add more modules
Outline shader is post processing dude... You cant add outline without an image effect
Worry not for i just passed the same situation. Not hard to fix
You have to kbow exactly what your version is, then google to download the unity assistant if that version. Once downloaded, you'll see you don't need hun anymore, because the download assistant has the ability to add modules just like hub does
Uh... You were right. I'll see if that works correctly. Thanks.
No, it doesn't have to be post processing...
In fact, if you are creative enough, you can have a simple outline without any particular/custom shader,just a simple unlit shader is enough
Like this
Yeah... Though technical that's an inline but as long as players don't realize it, it's fine i guess 🙂
I'm having trouble with my uhhh Unity Editor
It says on the editor that there are no android modules, but my Unity Hub says that it's installed.
I'm just pretty new to Unity
Did you install the modules when you had already started the UnityEditor? If so, reopen Unity
Yes, I did that but it didn't work
I installed it with Unity, but I encountered an error or something
so I aborted it
I went to make some stuff on Unity
but then I decided to export my project on unity on android
Beta Hub has problems installing Android SDK sometimes. Should switch back. Might need to reinstall Unity install if it won't allow you to reinstall the modules.
I'm actually downloading an older version of Unity
Hopefully it works
That's the Beta Hub problem though. You can just reinstall new one, no reason to go back
well, I tried reinstalling it, and it said something like "failed to delete old android thingys"
idk
but that's what it said as far as I can remember
that also happened while installing the older version
so it happened to both of them
It might be related to that it was not installed in the first place, but marked so by Beta Hub. Like I said convert to regular Hub and just reinstall
Beta Hub converted back by selecting build stream it's called something like that
in its settings
So I'll pick Production?
yes
this is what I'm talking about
any advice on what to do here?
any help would be appreciated
Yes. Open Preferences > External tools and confirm they are installed
in the hub?
It's a menu in Unity
Weird that your JDK was not installed properly. Did you choose it as a module?
Well try building something it could be fine
Otherwise you may need to reinstall the editor, I'm not sure if just deleting the modules will work, but might have to do that as well manually for that JDK specifically. Before reinstalling.
I see
try unticking it and ticking again. It sometimes bugs out.
Hello! I have a problem - I'm copying Texture2D to RenderTexture (R8 format). It works in Unity Editor. But not working on Android. How can I fix it?
So um putting 2 characters (Skinned Mesh renderes on em and so on)
is making psvita drop from 100+fps to like 55fps in certain angles
any idea what to do? (Gpu Skinning doesnt seem to do anything or makes it worse on here)
NOTE: they dont cast shadows.
That happends to me too
Hello,
I've got kind of a weird problem here. It's about IAPButton, in the editor everything works as it should (fakestore), but as soon as I upload a build to test on googleplay so when I click on IAPButton it doesn't react at all (doesn't pop up googleplay store) just absolutely nothing happens. OnClick on Button component gets called (test message), but IAPButton component on android absolutely does not respond. Previously the button worked without any problems, but then all of a sudden it stopped responding and yet I didn't change anything about the button or the function of what should happen on purchase.
Try profiling if possible on the device.
If not, profile in the editor and see if there's anything you can optimize. You need to determine wether it's a CPU or a GPU bottleneck to know what to optimize.
When i trying to build app on android i got this errors
Library\PackageCache\com.unity.collections@0.14.0-preview.16\Unity.Collections\NativeList.cs(709,24): error CS7036: There is no argument given that corresponds to the required formal parameter 'safety' of 'NativeArray<T>.ReadOnly.ReadOnly(void*, int, ref AtomicSafetyHandle)'
Im on Unity 2020.3.20 and "com.unity.platforms.android": "0.9.0-preview.9". IOS is ok
Are you using native collections in your game?
Yes, i am using ECS/Collections/Burst and etc
Perhaps the version of collections that you're using is not supported on android?🤔
My Facebook isn't logged in on browser. Although updating FB sdk fixed it. Facebook now authenticates it through facebook app rather than embedded login page
ill try it thanks
Nobody knows? 😦
Did you try checking logs from your device, maybe there are some errors
If this is a response to me, then I did not find any log in the phone from my application.
But as I wrote, I didn't change anything and it completely stopped working for no reason
Get logcat package and see the logs live when your device is connected. If no errors appear, add debugs along your code to see what's going wrong.
Hello
i need help related publishing games on google play
I cant find any other channel to seek help
So i made games on unity and published in playstore with unity ads
what happens to the revenue?
I can see some data on unity dashboard, but on google play console, it says i need to make a merchant account to see financial data
do I need to make that?
The Play Console doesn't have anything to do with Unity Ads
The financial data there is for paid apps and in-app purchases (and possibly Google Ads revenue, not sure)
Oh, i see
thanks a lot for your help.
I have previously had firebase working fine, but now I installed crashlytics too and this error came up:
None of your spec sources contain a spec satisfying the dependency: `Firebase/Analytics (= 8.7.0)`.
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
If I try to run the command it suggests pod install --repo-update in the build folder, the error still comes up just without that line. The next suggestion I don't have control over as they are coming from the firebase/crashlytics packages, and I have no idea what the last point is all about. Is there something specific I should try out to get the build working again?
Currently, when I touch with two fingers on android, it treats it as a right-click. I would like to treat a pinch as a scroll instead of as a right click. Is there a way to do this easily with Unity? (I want to avoid having to re-do all the input control for android, everything will work well if pinch == mouse wheel scroll).
I get these errors when selecting android in the profiler (via usb)
I had this issue, was a headake, I got around it by just using the "build and run" button instead of trying to reconnect a running game,
Sadly I get an error when I do that. Im installing my vr game via sidequest
no idea, for me I was getting that a lot, I just restarted PC and did "build and run" making sure to select my device on the "run device" and it worked, and that's how I've been doing it since. No-one here managed to figure out another way to fix that by using anything other than "build and run"
Restart might be a good idea lol
I saw an issue about it with a fix being made in 2021.1.X
I was before loading my APK onto my device, running it and trying to connect it to the profile
Fair, imma restart and try, thanks
no matter what I did it didn't connect kk
good luck
Currently, when I touch with two fingers on android, it treats it as a right-click. I would like to treat a pinch as a scroll instead of as a right click. Is there a way to do this easily with Unity? (I want to avoid having to re-do all the input control for android, everything will work well if pinch == mouse wheel scroll).
@iron acorn would you happen to know how to do this?^
Maybe calculate the distance to see if it's just a click? (if under 1, right click) and if the fingers move calculate the difference in distance and use that?
I don't want to do any code here so I don't have to change my code for android. Currently it treats a 2 fingered click as a right-click. This is some kind of default. I want to know where this default is set and if I can change it to think of it as a scroll wheel instead
^can't seem to find docos on this hence asking here
Old or new input system?
new I guess
Did you install the package?
No clue about the new input system. Maybe ask in #🖱️┃input-system
mk thanks
just in case, would you know for old one?
For the old one you'd probably need to implement it yourself using GetTouch() and similar api.
.> kk ty
Looks like the new input system might be what I need, thanks
Just worked after restarting my PC
Whoops haha
Anyone here using a visual scripting tool?
so yea, I might not be the first one here to ask this butt.. could someone tell me what's wrong with my setup to debug my android game on my android device using unity remote 5?
I'm getting error
C:\Program Files\Unit\2020.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\adb.exe forward tcp:7201 tcp:7201
stderr[
error: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
]
stdout[
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <2c6e9a95f1dd4e06ad71afcd2684dcb7>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <2c6e9a95f1dd4e06ad71afcd2684dcb7>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <2c6e9a95f1dd4e06ad71afcd2684dcb7>:0)
UnityEditor.Android.ADB.RunInternal (System.String[] command, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <2c6e9a95f1dd4e06ad71afcd2684dcb7>:0)
UnityEditor.Android.ADB.Run (System.String[] command, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <2c6e9a95f1dd4e06ad71afcd2684dcb7>:0)
UnityEditor.Android.ADB.Run (System.String[] command, System.String errorMsg) (at <2c6e9a95f1dd4e06ad71afcd2684dcb7>:0)
The error message says that my device is unauthorized, and that I should check for a confirmation dialog on my device, thus no confirmation dialog shows up anywhere.
I have done:
- Setting device in external tools to
Any android device - Setting platform in build settings to android
- Enabling dev mode and USB debugging on my phone
- Made sure that I can access my phone with my pc
- Tried restarting unity, my phone and my computer
I'd appreciate ping once someone reacts to this 
have you tried debugging with android studio?
nope, I never debugged anything remotely lile this before
@drowsy elbow Your device isn't authorized. Have you enabled Android debugging on your device? When you plugged it in did you get a message to authorize?
I have enabled dev mode and USB debugging, thus when I plug in the USB wire the only messahe I get is if I want to use the USB to charging, transferring photos or transferring files.
Have you tried with 'build and run' OR only Unity remote?
only unity remote to play test my game
Try building the game instead. I wouldn't advice testing with unity remote anyway.
well I don't want to build the game each time I change few values when debugging something
and I need unity remote 5 just because I can't do 2 or more touches with mouse at the same time
Do you really need to test on the device after changing a few values?
aah
touches
@drowsy elbow If you open build settings, does your device appear in the Run Device dropdown?
There is a setting in the Android development menu to change the USB mode so it can be properly recognized. It is complaining tha you didn’t approve the computer on the Android device
Device unauthorized means it is specifically needs you to say yes to allowing the connection on the android device
@drowsy elbow Try clearing authorized devices in your developer settings on Android and re-connecting. You should get an alert that shows a fingerprint and asks you to authorize. I've run into this before and clearing previously authorized devices and some reboots cleared it up.
does anybody have knowledge about admob
I can't connect to my phone can someone help?
Trying to use Unity remote 5 but it wont coonect
please ping me if you got an answer
2 questions (of some?) for mobile developers (iOS specifically) that are experienced with Unity:
- When exporting the project to XCode to compile and run on a development device (ie. iPhone XR/6S/etc), I noticed with Unity 2019.4.x builds that XCode complained about deprecated languages and whatnot, like "don't use things like lang.en.plist, use one Language.plist and define all strings there" (not 100% sure on terminology here). I know this is moot point but do newer versions of Unity address this, or is it solely there so developers using newer XCode on older versions of Unity (ie. XCode 15 with Unity 2019) don't get a compile error or issues in the build process?
1a) Unrelated but I do know that Unity's headers and library makes XCode emit a LOT of "unused variable" and constructor warnings/deprecated warnings, but no fatal compile errors. I assume that's just compatibility stuff.
- When exporting the project and going to build, I have to open the Xcode project with the IDE and then manually set what I'm signing it with (ie Personal Developer, my apple ID). Is there a way to tell Unity on Mac to say "Hey, I want you to export this project, but set it to be signed with my development key/licenses that XCode knows about" ? Otherwise I can get a compile happening but as soon as it goes to push it to the target device, it fails because my device does not accept unsigned development packages, and says "Please go and set the signing property in this page, blah blah".
Hey y'all, does anyone know if it's possible to do runtime c# compilation on android?
I'm trying to see if I can get an open source project to run on Android, but I get these errors related to runtime compilation that'd I'd like to resolve if possible
does anybody have knowledge about admob
@pseudo kiln don't use your personal admob else you'll have problems, just telling you the main truth
I tried that, cleared authorized devices, plugged in and again no RSA authorization popped up
Anyone know how to get a project to a .apk so that i could maybe play it on mobile?
Build it.
I am trying to reduce my build size is there any way to:
- List all textures/images that do not have a reference in any built scene so I can remove them?
- A tutorial for: https://developer.android.com/guide/playcore/asset-delivery/integrate-unity#install-time-deliverythat the install-time delivery method for asset bundles? Not clear on a few things, would be good if there was a tutorial to follow.
Unity already should be stripping unused assets. Use something like the Build Report Inspector package to see what is and isn't in the build.
Why is this window? I can't find it anywhere or any info on it...
prolly when you try to build an apk thats more than 100mb?
Found it, its available when you install the google plugins for android
Hey watch this video https://youtu.be/fGMFHN3gXpY
Here You Get 62 Game Development Courses Boiiii
https://www.awesometuts.com/ultimate-game-dev-academy-dis?utm_medium=youtube&utm_source=tutorial_video&utm_campaign=unity_admob_tutorial
Website
https://www.awesometuts.com
Reference Links
https://developers.google.com/admob/unity/start
https://developers.google.com/admob/unity/test-ads#enable_te...
Hi, I am in need of suggestions.
I am creating a Mobile game and it contains a lot of objects (roughly 3000 static objects per level) but also a decent amount of levels (20 levels currently)
When the game was a bit smaller (10 levels), it ran more efficiently.
We believe we have optimized most things but it comes mostly down to the amount of objects we have in the game.
We currently store each level in a prefab but these prefabs are also referenced in the scene so we understand that they are all loaded into memory and may cause the increase in lag.
We are looking to only load each level when need but the difficulty comes from the fact that each level mostly shares the same objects.
We have recently tried using Addressables but to no success in performance and I understand that we implemented everything correctly.
We are looking into using "Scene Streaming" next and storing each Level in another Scene. Will this work by any chance?
Also, any suggestions for improving performance is greatly appreciated!
Did you actually profile the game to understand what causes the performance drop?
I have. It seems mostly to be just the amount of objects as well as the drawing of them. We have done things to decrease this such as making sacrifices like turning off shadows completely, lowering polygons, etc
Do you mind if I have a look at some of the profiling data?
Of course, how would you prefer it
Either a few screenshots or save the profiler data to a file.
I have a single screenshot currently as I am semi-AFK but if needed, I can provide more but it would have to be later today
@grand novaIt's not a lot of info, but there are already a few red flags - crazy amount of draw calls, crazy consumption of memory by textures and quite a huge amount of vertices.
And your meshGenerator is doing some crazy calculations, but it might be fine if it's only once( OnEnable)
I'd like to have a look at an average frame data. The above one seems to be during a spike.
I notice that. How would I reduce the number of draw calls? I am unsure why it even has as many as it does. This screenshot is from yesterday and today I had made a few changes to help with those areas but I believe they are still problem areas. Give me a moment and I can provide you with more screenshots
Drawcalls can be reduced with static/dynamic/SRP batching and/or gpu instancing. Each has different requirements and use cases.
Additionally, decreasing the camera frustum far plane distance would reduce draw calls by culling more objects.
Here is an updated screenshot
as I mentioned, I had made a few changes today so you can see some reductions
but also, this level has fewer objects than the last screenshots
regardless, this level still heavily lags on mobile
When we used to only have around 5 levels referenced, we would get much better performance on mobile, but now that we have 15+, the lag is insane
There're still too many batches. They should be around 100-300 on mobile. And the memory consumption is even worse than on a previous screenshot.
You should probably split the levels into separate scenes, so that they are not loaded into the memory at the same time.
Yeah, I had tried to fix things and although I thought we were doing quite well as the FPS was improving, it was only really like that because of me testing on PC
Ah okay, so this was the next thing that I was going to look into trying; Scene Streaming.
Definitely. In fact, I'm surprised your game doesn't crash on the device.
Also, I had tried to reduce the number of batches in the past by GPU Instancing common materials as most of these objects all use the same material
but it had created a weird glitch where lots of the objects were disappearing or appearing as black
Not sure about streaming(isn't it for ECS only?), but simply splitting the game into regular scenes, should do the trick.
For GPU instancing the objects need to have the same Mesh and the same Material.
I meant Scene Streaming as in having each level in a different scene and then when I need the level, to load it into a Default Scene so that theres 2 scenes in 1. If thats what you meant as well?
The most common technique is static batching(or SRP batching on URP). Or even better: combining the meshes before the build.
I don't think that's a good idea. Not sure if you can unload scenes that were added additively.
It looks to simple! How the heck does it produce these crazy stats?
Oh? What did you mean by putting each level into their own seperate scenes then? Wouldnt I still need to load/stream the scenes into a master scene that contains all my controllers, etc?
That is what im saying! haha I have no idea how
My original idea was that it must be loading every single level in that I have referenced in my Level Manager
bc the game only got more and more laggier the more levels I made
No, you just call SceneManager.LoadScene/Async and it loads new scene and unloads the old one.
Yes, that's quite likely.
Also, you're probably using textures of huge resolution and no compression..?
Makes sense. Which is why my next idea was to use this Scene loading technique we're discussing
I have tried to compress all the textures I can and also, in my build settings, I have it set to automatically compress as well
Make sure you have compression enabled on all possible assets(textures/models)
Well, 4GB of texture memory is quite a lot even for a pc game.
Use the memory profiler to find out what eats all the memory and optimize it.
Yeah, thats a good idea
Is this only included the objects in the scenes or is this every single file in my project
Switch to detailed mode and take a sample.
There's a lot of noise data from the profiler and editor. Try taking a sample on the device.
How do I do that easily?
Build and run a development/debug build. Check autoconnect profiler. When the build is complete, your editor should connect to the device automatically. Then it's the same from there.
Hey, thank you for all your help! I am confident that I can continue going forward with what youve helped me with
Also one last thing, I see that some of the things referenced here arent actually included in the Scenes or referenced at all but are included in my projects files. Does every project file matter when building the game?
Actually, could be included in another level and since all the levels are currently in memory, they are affecting the constant outcome?
You mean the last screenshot?
I think I figured it out. It must be the memory issue with the levels. Ill split them all up into scenes and such. Thank you again! Youve been tons of help
Memory profiler in the editor doesn't know to make difference between the play mode and the editor memory, so anything loaded into memory(for example, if you edited some prefab) would appear there. That's why you should profile on the device. Especially memory profiling.
But performance profiling is also more accurate on the device, so yeah. You can profile in the editor to get the overall idea of what's slow, but definitely look at the data from the device too.
For batching/instancing, use the frame debugger to see why draw calls don't batch.
hey guys are these settings ok for my build of a game i build in 1920*1080 landscape? IDK anything about these. The outcome(app) which comes in my mobile always is of different type as well. The buttons here and there and all
Wdym by "of different type"?
what are your canvas/camera settings
I dont know why my rewarded video or my institial ads are not working. I made a tool for testmode and set it to true(when you know what i mean) and enabled testmode in the services but still i get this error should i post my code?
I get this error now ArgumentException: method arguments are incompatible System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method, System.Boolean throwOnBindFailure, System.Boolean allowClosed) (at <695d1cc93cca45069c528c15c9fdd749>:0) System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method) (at <695d1cc93cca45069c528c15c9fdd749>:0) UnityEngine.Events.InvokableCall..ctor (System.Object target, System.Reflection.MethodInfo theFunction) (at <127e81e1cb3441cc97d26b1910daae77>:0) U... long text
This is my code
@last stump have you tried updating the unity ads package?
I'm working on a game for ios and want to send a rating notification when the player plays the first level or plays 2 or 4 levels in consecutive succession. How should I schedule this "rating notification" and check if it has already been rated??
I'm having a problem with the VSync in Mobile, The game is fine, however the longer I play the game, on one moment the Target FPS become half of the previous one (Sort Of). How to fix this issue? (This is tested using Development Build in Android)
It could be due to your game heating up the device. When the device is heated up to a certain threshold, it will throttle the performance down to cool down.
Ah so the problem was affected by the Adaptive Performance?
What I mentioned is not adaptive performance though. It's something built-in in every mobile device.
It's to avoid damage to hardware due to overheating.
How to control that? I'm using URP in my game
In general, by optimizing your game, reducing the target framerate and memory consumption.
Check and see what's taking most CPU time before performance drop and try to optimize it.
Also if GPU profiler module is working with your device, might be a good idea to look at it as well.
So basically lower your FPS
Yeah. The recommended fps on mobile is 30. But it seems like it's already around that number for him.
I'll check that out again, cause I'm a bit confused because there's nothing else except the VSync which eating the FPS
I already do that previously using Application.targetFrameRate = 30 but still happen after that
Are you enabling the vsync too?
Also before I implement that, it's already capped on 30 FPS
Disable the vsync. If you have target framerate set, it's not needed. And they might behave weirdly together.
You usually use either vsync or target framerate, and from what I heard vsync is not favorable on mobile.
Oh ic ic... That one looks really suspicious, I'll try remove that and instead using the target framerate only
I implement that and it was working, tq
Has anyone had trouble with setting up subscriptions for Google Play? The in-app products work fine but I can't seem to get the subscriptions to work (product id returns product not availabe).
It's up to date
I have working ads on my other project but it was installed from the unity assets store for this one i had to install it from the package manager bec. It was not anymore available for the asset store can it be because of this. And on my other project i don't have the newest version liked the old ones but works
Maybe the coding changed for the newest ones
How do people decide on resolution for their sprites? I know "start w/ big and let Unity resize w/ anchors", but I'm not sure how to pick the main size. I've blocked out my UI, and want to start replacing assets with real buttons and images, but I'm not sure where to start.
For instance, that big circle with the "103" in it... Should I make an image in Photoshop that's the dimensions of the current largest native resolution, size my circle graphics to what I want it, and then import it? Does that approach have downsides?
You set a reference resolution on your Canvas, something like 1080x1920. You then create the assets to scale for that resolution, import and set them to their native size.
Aaah. I looked into it, but I didn't understand reference resolution... That's awesome. Thanks! And just to be 100% clear, I'd want to set the reference resolution to the max I expect to see, so I don't run into upscaling issues, right?
Yeah, if you plan on targeting tablets for example.
I am. It's a BLE motor controller, and people will want to use phones and/or tablets depending on what they have available.
Yeah, then just take a tablet resolution as your reference and run with that.
Does anyone have a tris reference for mobile 3D Games?
Hey everyone, it looks like Unity IAP is returning all products from Google Console as non-consumable products. The subscriptions don't have any more info such as price and description though. Has anyone faced this?
Hello! Is it maybe possible to be able to make a android service in unity. I want to be able to run a script while the app is closed. I found out you will need to make a service for that. How would i do that?
Do you use any unity features for that? Looks like you just need code to ms
Hello. So I'm trying to make an Idle Clicker and I have some question.
I made a GameObject to handle the tap logic and it is working, the problem is that I gain money anywhere I tap on the screen and I can't enter into any menus because of that.
Should I make a canvas to limit the tap area, and basically transform my GameObject into an UI Element?
hi, im building an android game but im having an error thats says
Build failure:
Failed to update Android SDK Package list. See the Console for Details
and the console says
CommandInvokationFailure: Failed to update Android SDK package list.
im trying to build to ios and im getting this error:
BranchUniversalObject.m:513:9: Cannot use '@try' with Objective-C exceptions disabled
How can I fix this?
this is in xcode
and I have enabled objective-c
so something funky is going on
Hi, I'm trying to build for Android, but I have an error (Gradle error). How I fix this, I have watched a lot of videos in Youtube, but that not solve me the problem.
what error exactly?
it's when I make a build, I go take a screenshot, wait
Have you downloaded the entire android build module with your Unity version in the Unity Hub?
You can change the order of canvasses, if 'block raycast' or something like that is set with the objects in the canvas, the buttons etc behind them cannot be pressed.
After importing google play plugins, I get a lot of errors on aab build for things like:
"Duplicate class com.google.android.play.core.appupdate.AppUpdateManager found in modules core-1.10.0-runtime.jar (:playcore:) and core-1.10.0-runtime.jar (com.google.android.play:core:1.10.0)"
Where are these duplicate google play files? How can I add the google play plugins without duplicating all these?
have you tried 'force resolve' in external dependency manager -> Android?
No, where is external dependency manager?
this?
If I remember correctly at the top at Assets menu dropdown near the bottom
Nup have no such thing
This is the one with the latest version, yes
cool thanks
still get the same duplicates even after force resolve. Any other suggestions?
is "Cannot use '@try' with Objective-C exceptions disabled" fixable?
enabling Objective-C doesn't change anything
and disabling Log Obj-C Uncaught exceptions in unity doesnt help eitther
ah it was caused by a bad plugin that was using objective c
there are a few more problems but its getting better to build now
uh yes i think, i have sdk and jdk for building in android
I had a lot of those errors myself, but because of Unity ads and mediation. The easiest way is probably to remove the plugins you don't plan to use (if that's possible). (I had to remove either Unity ads or Unity mediation due to duplicate files)
Otherwise this is another github issue page with exact your error, maybe there is another helpful solution: https://github.com/google/play-unity-plugins/issues/104
Anyone here used Unity as a Library? How can I run Application.Quit() WITHOUT exiting my parent app? Anyone from Unity know the answer to this?
Hey can anyone help with this question? cheers..
https://stackoverflow.com/questions/69889824/unity-mobile-how-to-access-location-in-background
Hey! Im looking for an asset that can make a 3D tree to a quad / low tris LOD item - kind of like this https://assetstore.unity.com/packages/tools/modeling/quadit-70519
Any tips?
This is last released 2017 so i imagine there would be other options too
there seems to be a few tools that do it on the asset store
not sure about quads specifically
but yea
I do have some android building problems that are breaking my current project.
Every time I try to build a project to android, I get a bunch of sharing violation path errors.
They wouldn't be so bad if they didnt also break unity from running in play mode too
like, there were no errors before building and I could go into play mode
but now there are errors here and I cant go into play mode now
what should I do if building to android always breaks the project?
Hmm, yeah a tool like that would be perfect¨
I bought a really good package with trees but i need more lod levels
Preferably also as low as quad
About your problem..
Best you can do is to google them i think¨
Many people have error with android builds in general so probably you can find a hint
I havent found anything yet
its mostly said that the file is in use somewhere else
but im not sure how a library file specific to the app could be in use somewhere else when there is only one instance of the project running
yup restarted it
it was suggested that there might be an old apk somewhere sttopping it
but I cant find it if there was
i re installed everything but i still get this error
nvm
Can somebody help? How to remove OpenGL validation at runtime? Oculus does it inside their .so file - how can we do it in Unity?
Hi guys, how are you?
So, can anyone help me adapting this script I made using mouse inputs into an script usable for android? Also, how do I limit where the user can tap, so it doesn't conflict with the UI.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Like, do I just use a canvas?
no one answer questions in here
@polar mason Did you read the error it gave you, have you actually installed the tools?
i didnt deleted any file, i extract it as is
and its showing that
but dont bother helping me, i gave up already
goodnight, thanks for concern
If you enter a specific mode where you want to ignore UI, set it to ignore raycasting.
@polar mason You need to install the tools. Find the installation in the Unity Hub and make sure you've added Android components, including all subcomponents. You can lookup install details in the manual.
look, everything is installed, watched countless tutorials, read countless forums, nothing is working, its either my fault or my laptop is fucked
its probably my fault
idk why, but, it probably is
wasted a lot of time, i give up
@muted night Don't spam the channel, please. If you have a question ask it.
Is there a reason why we now have to do this in 2021.2, instead of just putting files in Plugins/Android? https://medium.com/jasons-devblog/creating-an-aar-plugin-for-unity-31ed219cb7f5
help i accidentally remove classes.jar in my android folder. How to restore it?
can you guys me a copy of yours if you have one it is 2020.3.20f1 folder that i deleted
Is it possible to use video from xeternal device for arCore?
Hello friends! I have 3 games published on the Play Store. Average daily downloads are 70, 40 and 30. Yesterday something strange happened, two of the games had 0 downloads and the other only 1. This had never happened. Any clues?
Might just be a data error
It has happened to my apps too
So i would say check back
Else, make sure it is up on the store
Like search for it from a device
Probably nothing to worry about
Ive reinstalled and uninstalled 3 times now, and rebooted the pc 5 times, tried a bunch of things I found from google
I cant get this to work, its been almost 4 hours
I had this issue with unreal engine and it took 15 hours to fix, almost a week.
I had to break my unreal engine android sdk setup to get unity moving, and now both are broken
Got it, worked in 2019.4.31 I dont know why it didnt in 32, maybe because I installed android tools AND THEN the openjdk and sdk ... At least it works now
could anyone tell me if its possible to check if ads work properly in google play internal tests of the game??
Android builds in 2019.2.21f1 are taking forever because "moving mapping file" seems to hang. Anyone else having that problem? What is that mapping file anyway?
I want to add ads in my mobile game. I have used Unity's guide and everything is working perfectly. Its just that i have 2 scenes that I want to show ads to and I was wondering if i should do DontDestroyOnLoad on one and have it for both scenes or just have the same game object in both of them
Little confused about Vsync and lowering FPS on android. Apparently you cannot turn Vsync off on Ios Android, but according to the docs, if Vsync is on then targetFrameRate is ignored. So how do I set the framerate to 30 FPS on android if I cannot turn off Vsync and targetFrameRate is ignored?
Depends on your design IMO. If its the same, then it would be more peformant to keep it over scenes. You should make it a little mroe sofisticated though so that you can open any scene and it will load up like a singleton without an issue and persist over the scenes that matter.
But, I would even suggest, if you have two scenes with the ad in the same location, do you even need to change scenes?
Execution failed for task ':launcher:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
C:\Users\user\.gradle\caches\transforms-2\files-2.1\faa532047f8bfb910c3695709bd24b78\eos-sdk\res\layout\activity_eos_web_auth.xml:9: AAPT: error: attribute layout_constraintBottom_toBottomOf (aka my.package:layout_constraintBottom_toBottomOf) not found.
C:\Users\user\.gradle\caches\transforms-2\files-2.1\faa532047f8bfb910c3695709bd24b78\eos-sdk\res\layout\activity_eos_web_auth.xml:9: AAPT: error: attribute layout_constraintEnd_toEndOf (aka my.package:layout_constraintEnd_toEndOf) not found.
C:\Users\user\.gradle\caches\transforms-2\files-2.1\faa532047f8bfb910c3695709bd24b78\eos-sdk\res\layout\activity_eos_web_auth.xml:9: AAPT: error: attribute layout_constraintStart_toStartOf (aka my.package:layout_constraintStart_toStartOf) not found.
C:\Users\user\.gradle\caches\transforms-2\files-2.1\faa532047f8bfb910c3695709bd24b78\eos-sdk\res\layout\activity_eos_web_auth.xml:9: AAPT: error: attribute layout_constraintTop_toTopOf (aka my.package:layout_constraintTop_toTopOf) not found.```
Could someone maybe help me solve this error?
@me so I see the reply tyvm :)
Please help, tried everything to fix it - Releasing render texture that is set as Camera.targetTexture! Context : Android, using custom render texture (asset) in the addressable prefab. When releasing gameobject via addressable release instance - it always throws this error. What should I do?
@frail grotto Don't cross-post. You also don't show any error.
Releasing render texture that is set as Camera.targetTexture! - pretty obvious error, or is it?
can someone help me, i m trying to make this UI to appears in front of an object to make some "settings menu" i was trying to make this UI rawImage to appears in front of the object so it will cover the object but the UI keep getting render below the Object layer ;-;
nooo, I made my whole project by asking from these people. So its not like that. It depends on the problem 😅
Why are you using a RawImage and not a regular image?
idk i m still new on unity ;-;
Try with a regular image , however I don't really see the issue in your screenshot
that's because the problem only visible during the "play mode" o.o
this ;-;
Show your canvas settings
this ?? o.o
If you want your UI on top of everything, change it from camera mode to overlay
but isnt by doing that the UI no longer following where the camera facing ?? because on that app i was making the camera orbiting that cube o.o
No
no ?? so.. you said that if i change the UI render mode from camera to overlay the UI will still facing wherever the camera are facing ?? o.o
oooooo it works.. thx ole (>w<)
I get this error even though I have pasted in my android if from the dashboard in the inspector
"Error showing Ad Unit Rewarded_Android: NOT_READY - Placement Rewarded_Android is not ready"
public void OnUnityAdsShowComplete(string adUnitId, UnityAdsShowCompletionState showCompletionState)
{
if (adUnitId.Equals(_adUnitId) && showCompletionState.Equals(UnityAdsShowCompletionState.COMPLETED))
{
Debug.Log("Unity Ads Rewarded Ad Completed");
// Grant a reward.
// Load another ad:
Advertisement.Load(_adUnitId, this);
}
}
The ad loads normally but this function never gets executed. And thus the ad doesn't get reloaded. This is my code for when the ad finishes successfully
is there a way to fix having a black screen on an ios build?
there arent any errors being reported to xcode
and there is zero cpu usage which shows that nothing is running
but there is a scene with content being built
public void PlayRewardedAd(Action onSuccess)
{
onRewardedAdSuccess = onSuccess;
if (Advertisement.IsReady("Rewarded_Android"))
{
Advertisement.Show("Rewarded_Android");
}
else
{
Debug.Log("revarded ad is not ready!");
}
}
public void OnUnityAdsReady(string placementId)
{
Debug.Log("ads are ready");
}
public void OnUnityAdsDidError(string message)
{
Debug.Log("ERROR: " + message);
}
public void OnUnityAdsDidStart(string placementId)
{
Debug.Log("Video Started");
}
public void OnUnityAdsDidFinish(string placementId, ShowResult showResult)
{
if(placementId == "Rewarded_Android" && showResult == ShowResult.Finished)
{
onRewardedAdSuccess.Invoke();
}
}
}
``` does anyone know why is not shoving PlayRewardedAd
in editor this code is not activated indeed, should have already been passed on to the team by support. If you try in build without 'development build' on, it should work
you mean to turn of test mode?
In build settings, 'development build' (when I tested with this on, it didn't work on Android either, without it it did)
Test mode should stay on until actual release. They can block otherwise I thought
Just don't have Unity on here now, so can't send a screen
development build was turned off and it didn't work, I turned it on and it still doesn't work
In editor or your build?
editor
Apparently I wasn't clear enough :-)
It doesn't work in editor at the moment, they are working on solving that problem
In build it works, if 'development build' is turned off
Oh ok
I guess I misread that as it seems quite clear you were telling me exaclty that, sorry
thanks for the answer
no problem 😄
hey is there a way to make profiler tell me how much does each script cost and not all of them together
?
vgm that's called Deep Profile
so how do i understand which script is which
Set timeline to ... in Left bottom corner, don't know exact name
Then you get a list instead of a timeline.
I'll startup Unity, to check names
ok thx
I have it set to 'normal' hierarchy