Quantcast
Channel: Questions in topic: "profiler"
Viewing all 853 articles
Browse latest View live

How to determine which part of the game is crashing Unity Editor

$
0
0
HI all, When i play my game in the Unity Editor, it runs for about 15s and then Unity freezes. I tried the profiles but i don't know what to look for. Even if i manually disable parts of the code and find out which part of the code is causing it, how do i troubleshoot/debug the problem? I am quite inexperienced and new to Unity5 I really appreciate any help you can provide me. Thanks.

Unaccounted time between: Start of Frame and Camera.FindStacks

$
0
0
![alt text][1] Are you have any solution suggestion about for that? Thanks in advance. [1]: /storage/temp/111139-screen-shot-2018-02-12-at-035354.png

Coroutine being iterated in an unrelated function

$
0
0
Dear Community, Using the profiler I have found that a coroutine seems to be involved where it shouldn't. Since I am using coroutines for the first time I would like to understand why. I'll explain: In my game I have a grid of 8x8. Like so: ![alt text][1] The grid (which is a 2 dimensional array of the custom class "Piece" is populated at runtime via a coroutine in my GridManager class like so: public class GridManager : MonoBehaviour { public Piece[] prefabs; private static int cols = 8; private static int rows = 8; private Piece[,] grid = new Piece[cols, rows]; private List subGrid = new List (); void Start() { StartCoroutine (InitialiseGrid()); } public IEnumerator InitialiseGrid () { for (int c = 0; c < cols; c++) { for (int r = 0; r < rows; r++) { yield return new WaitForEndOfFrame (); Vector2 gridPos = new Vector2 (c, r); int randomIndex = Random.Range (0, prefabs.Length); Piece newPiece = Instantiate (prefabs[randomIndex], gridPos, Quaternion.identity); grid [c, r] = newPiece; } } } } When the player clicks on one of the Pieces in the grid it and all its neighbors of the same color disappear. This is managed by my InputManager like so: public class InputManager : MonoBehaviour { public static bool yourTurn; public GridManager grid; public ParticleSystem explosion; public Ball[] balls; private int X; private int Y; private List subGrid = new List(); void Update () { if (Input.GetMouseButtonDown (0) && yourTurn) { //calling a function that populates subGrid with the colored Pieces I clicked on; DestroyPieces (); } } void DestroyPieces () { int tempIndex = (int)subGrid [0].element; foreach (Piece p in subGrid) { //Instantiating ParticleSystem explosion with appropriate color; Ball ball = Instantiate (balls [tempIndex], p.transform.position, Quaternion.identity); StartCoroutine (ball.Ammo (heroes[tempIndex])); } } } In the place of the Pieces little balls are spawned. These balls have on them a script called "Ball" which uses a coroutine to move them to a specific point like so: public class Ball : MonoBehaviour { public float speed = 5f; public IEnumerator Ammo(Hero target) { Vector3 targetPos = target.transform.position; while (transform.position != targetPos) { float step = speed * Time.deltaTime; transform.position = Vector3.MoveTowards (transform.position, targetPos, step); yield return null; } // Do something with the target Destroy (this.gameObject); } } When I check my profiler at the frame where I click somewhere in the grid, there is a massive spike in the CPU section. Now, I know the spike is due to my instantiation of the balls, and ParticleSystems and something with my additive material for the ParticleSystem called: Shader.EditorLoadVariant. But there is something going on where my "InitialiseGrid" Coroutine is involved. But that should have finished by now. Only the balls coroutine should be happening. Does anyone know why this is happening? Thank you in advance. ![alt text][2] [1]: /storage/temp/111296-game-screenshot.jpg [2]: /storage/temp/111297-initialisegrid.jpg

Profiler FindObjectsOfType very slowing down game.

$
0
0
It try to detect destroyed objects, like my collectibles And some times is freezes and sometime it slowing down fps very much *How to decrease this effect or maybe unable it?* It very strange that is slowing down everything because its a 2d game and seems like FindObjectsOfType trying to find objects every frame *Please try to help!*![alt text][1] *Maybe it's something on the script, but its not..* void OnTriggerEnter2D(Collider2D col) { if (col.gameObject.layer == LayerMask.NameToLayer ("food")) { Destroy (col.gameObject); score++; } [1]: /storage/temp/111347-screen-shot-2018-02-15-at-161207.png

Build Report Log misses 50% in filesize count?

$
0
0
Hi,


It's kind of hard to explain for me since I'm new to 'profiling' my game, but here it goes:

On a Unity page I read that you can check a editor log in the terminal. I did this because I wonder why the filesize of my game is 126 MB! The weird thing I encounter (which might be normal?) is that in my report it says:


------------------------------------------------------------------------------- Build Report Uncompressed usage by category: Textures 32.9 mb 27.2% Meshes 875.5 kb 0.7% Animations 8.6 kb 0.0% Sounds 0.0 kb 0.0% Shaders 5.0 mb 4.1% Other Assets 416.8 kb 0.3% Levels 56.0 kb 0.0% Scripts 758.6 kb 0.6% Included DLLs 3.9 mb 3.3% File headers 25.3 kb 0.0% Complete size 120.8 mb 100.0%
The funny thing is, as you can see, it counts up to 100% but it leaves out explaining where the other 65% went/is.


Does anyone know how and why this is happening?

Thanks in advance!

[Help] Calling a function, involves another function that is completely unrelated

$
0
0
Dear Community, I am very confused because in my little project I am calling a function that should not be connected in any way to another (completely unrelated) coroutine. However when I check with the Profiler, apparently that coroutine seems to be involved in the process. Its like this: On my GridManager Script I am starting a coroutine InitialiseGrid in Start(). So a grid of 8x8 colored pieces is initialized. Then, when I click on one of the colored pieces I am calling a function in my InputManager, that creates a List of equally colored pieces, iterates through them and in their place spawns a little ball with a coroutine on it to move it. Like this: public class GridManager : Monobehavior { public Piece piece; //this is a prefab private Pieces[,] grid = new Pieces[8, 8]; private List subGrid = new List(); void Start { StartCoroutine(InitialiseGrid()); } IEnumerator InitialiseGrid { for (int c = 0; c < 8; c++) { for (int r = 0; r < 8; r++) { Vector2 newPos = new Vector2 (c, r); Piece p = Instantiate (piece, newPos, Quaternion.identity); grid [c, r] = p; yield return null; } } } public List CollectPieces (Vector2 clickedPos) { int x = (int)clickedPos.x; int y = (int)clickedPos.y; subGrid.Add (grid[x, y]); if (x+1 < 8) { if (grid [x+1, y].color == grid[x, y].color) { subGrid.Add (grid[x+1, y]); } } return subGrid; } } public class InputManager : Monobehavior { public Ball ball; //this is a prefab public GridManager gridManager; private List subGrid = new List(); void Update () { if (Input.MouseButtonDown(0)) { //determine Position where clicked. If clickedPos is within grid: subGrid = gridManager.CollectPieces(clickedPosition); DestroyPieces (); } } void DestroyPieces () { foreach (Piece p in subGrid) { Ball b = Instantiate (ball, p.transform.position, Quaternion.identity); StartCoroutine (b.Ammo()); Destroy (p.gameObject); } } } Now when I check with my profiler at the moment where I click the mouse and some pieces get destroyed and some balls go flying, it says: ![alt text][1] So apparently my InitialiseGrid Coroutine seems to be involved when I click. But it shouldn't. Does anybody know what is happening here? I am afraid I might have done something completely wrong. Thank you in advance!! [1]: /storage/temp/111472-initialisegrid.jpg

Open Instagram Profile With Button

$
0
0
Hi, I want to open an Instagram profile with a button, but the following code does not work, you can help. using System.Collections; using System.Collections.Generic; using UnityEngine; public class contact : MonoBehaviour { public void insta () { string instagram = "url:instagram://user?username=the.msy"; Application.OpenURL(instagram); } }

Is it normal that "Clear" takes up most of the GPU?

$
0
0
Hi, This isn't really a problem but I was just wondering if everything is normal :) My Framerate seems pretty normal (40-50 FPS on Galaxy S6 - 80 meshes, 123k tris, 238k verts) but in the profiler (https://imgur.com/a/QqpMW) "Clear" is taking up 95% of the GPU time and the rendering of the objects (I assume that Render.Mesh renders the objects because it is using all the DrawCalls) is only using 0.2%. I don't know what Clear does but if it just clears the screen for the next frame 23ms seem pretty long. Correct me if I'm wrong :)

Ios Render performance help with profiler findings.

$
0
0
Trying to run a 2d Platform game on an iPad mini 1st gen (A5 chip) but it runs slow. This same game runs great on any apple device using A6 chip. Should I just drop support for older devices? Thank you all for the help! :D profiler info from iPad mini 1st gen. ![alt text][1] [1]: /storage/temp/106236-screen-shot-2017-11-25-at-34905-pm.png

SendMouseEvents - GC Collect Spike Issue

$
0
0
**Hello everybody,**

I was testing my game recently, checking the performance and I noticed the garbage spike out of nowhere, I looked it up and it was coming from 'SendMouseEvents'. It is a fairly big spike and I don't really know how to resolve this issue. Can someone give some tips on how should I deal with this problem? Thank you!

**[Profiler]**

![alt text][1] [1]: https://i.imgur.com/N0E6e9T.png

Why is UI taking this much performance and how to reduce it?

$
0
0
I have a simple UI with two list of items. But when I turn it on game drops from 150fps (in editor) to 55fps. And if I have deep profiler turned on then it goes nuts into 10fps. Here is the screenshot: ![alt text][1] [1]: /storage/temp/106674-qie47nylr-sxurbdyi1q2q.png I haven't worked too much with UI till recently. But is this normal? Is there something to be done about this UI lag? And finally, am I doing something obviously wrong based on this screenshot? Thanks!

Profiler using a lot of memory

$
0
0
My memory profiler is using around 1GB of memory for profiling data. This seems very strange to me, is there some way to limit the profiler or to change something in my project that'll reduce it?

High CPU Usage on GFX.processcommands

$
0
0
Hi, Im running into high cpu usage on gfx.processcommands and I got no idea what is this. Can anyone explain this for me? Thanks

CPU Usage Not Constant on iOS 11.2 (Metal) in Profiler and Xcode FPS CPU time != Profiler

$
0
0
Greetings... . I've been trying to get a consistent/constant baseline for CPU usage on iPad Pro 9" with Metal enabled. I had a look at this Bug: https://issuetracker.unity3d.com/issues/ios-gfx-dot-waitforpresent-spikes-on-metal-every-few-minutes which I suspect is responsible but it talks specifically about GFX.WaitForPresent and I'm seeing spikes in Physics, Other and Renderer. I have not filed a bug at this point, first wanted to ask it here. Thank You in advance to anyone providing insight. . Background: I have an empty scene with a plane and a cube, rigid body on the cube it's just sitting on the plane with a box collider. Lights are disabled, skybox disabled, background track is looping/playing, frame rate is set to 60. When I run this on the iPad and open up the profiler I see frame rate on the CPU reported below 250FPS (that's great!) but then I see spikes that reach to 100FPS (for no reason), some even to 60FPS or even 30FPS (although the latter does not happen often). The graph pattern is such that CPU usage goes low to ~250FPS then after a moment (2-3sec) it rises to a spike. Sometimes the spikes happen in the middle of the 250FPS section (if you take my meaning). When I remove metal and use OpenGL 2.0 I see a constant CPU usage, with metal I see this pattern of spikes and low usage (all over the place). With metal I see this even if I enable the Experimental renderer for metal in the Player settings. My concern is that when I start to add more and more functionality to the game these spikes will grow bigger proportionally. . - Am I the only person seeing this on iOS metal? Or is this understood and accepted behaviour? . The bug listed above states that iOS throttles the CPU usage to keep power usage small, then when a frame takes a bit longer to render it get's caught and we see a spike. In essence it's like working with a slower CPU for one or two frames. However what I'm seeing in the profiler seems to be all over the place disarray. Another thing I noticed was in Xcode Debug Navigator->FPS. When using OpenGL 2.0 with a device that is not Metal capable it shows the CPU usage that aligns with what Profiler is showing. If I run OpenGL on my iPad that is Metal the CPU in Xcode is 0 (not reported). I assume that this is an Apple bug or it just can't report in this circumstance. Lastly when I use Metal on the iPad Pro the CPU is always reported at around 16.6ms (which is the maximum for 60 FPS that my game is set at). Doesn't matter what is going on in the scene the CPU hovers around this area and never goes lower then that. This is not consistent with OpenGL 2.0 reporting with a GL device as noted above. . - Why is the CPU usage reported in Profiler (connected to device) so different to what Xcode is reporting? It seems Xcode is reporting max that I can have while profiler is showing the real value. Anyone else seeing this? Is this Apple or Unity issue? . If anyone can shed any answers or at least confirm what I'm seeing I would very much appreciate it. . Thank You, Regards. . PS: Sorry about the dots between the paragraphs but the paragraphs are not being respected in my browser. I'm using Safari (latest). Also tried HTML tags but they don't work either.

How to investigate spikes in total object count and meshes observed in the profiler?

$
0
0
I'm seeing gfx.waitforpresent spikes in the profiler, every couple of seconds or so. I'm sure it's a mistake on my part generating a ton of objects somewhere and then gradually destroying them before the next spike, where they're created again. How can I investigate this to pin down where the objects are coming from?![alt text][1] See the image below. When gfx.waitforpresent spikes up, that frame has double the meshes from the previous frame, and 100 more total game objects versus the previous frame as well. Can I somehow use the profiler or other tools to profile what objects or meshes exist in a selected game frame? I want to dig deeper but I'm unsure how to proceed. [1]: /storage/temp/107345-waitforpresent-spikes.png

InspectorWindow.DrawEditors high CPU in Editor.

$
0
0
I have a script that is causing a huge amount of CPU usage in editor.
I've spent fair bit of time trying to diagnose what is causing this issue. I know it is coming from a custom script because it only happens when I have this particular gameObject selected in the scene, and the gameObject only has one script on it.
The script it a weather controller script in run time, but it can also be edited in the inspector which changed the lighting etc in the scene through the `OnValidate()` method. The weird part is there is no issues in run time. It is purely a editor performance issue.
I have tried putting this script into another scene to test and further diagnose the problem but it runs perfectly fine in that scene. As soon as I bring it back into the production scene I am getting terrible performance. The profiler looks like this ![alt text][1] [1]: /storage/temp/107519-editor-profiler.png
I can't seem to find anything in the docs about these functions and/or googling comes to no end.
Does anyone have an idea what those functions are or know how to solve this kind of problem.
Any help would be much appreciated.
Thanks.

What`s CullResults.CreateSharedRendererScene do?

$
0
0
][1] ![alt text][1] [1]: /storage/temp/107690-2.png Will the game Caton in operation. It should be related to the camera, and the problem is difficult to locate. Who can see where there is a problem. I judge Camera.Render->CullResults.CreateSharedRendererScene 1,Camera.Render use time self too much .How can I find what`s wrong? 2, What`s CullResults.CreateSharedRendererScene do ?

UNITY Profiler shows higher CPU usage on Android than on editor

$
0
0
My 3D app gets a lot slower on my Android device, I checked the profiler and it seems like "Device.Present" takes 65% of my performance on Android. Also "Camera.Render" is 20%. I disabled the Canvas, and I only use default shaders. But I still get this result. I don't know what to do, this is the main problem with my app. ![alt text][1] [1]: /storage/temp/108372-3333.png

The Dictionary cost 400+b when construction,How to reduce it?

$
0
0
my unity version is 2017.2 when i create a dictionary,it cost 400+b in the profiler ![alt text][1] [1]: /storage/temp/108561-tim图片20180104215944.png how to reduce it?

Cannot disable VSync after upgrading to Unity 2017.3

$
0
0
Hello, I recently upgraded to Unity 2017.3, and while I have V Sync [disabled in the quality settings](https://i.imgur.com/lMSK5rM.png) and I do not have [any instances of Application.targetFrameRate](https://i.imgur.com/nC0Kl69.png) in my scripts, the [profiler is showing VSync](https://i.imgur.com/Hqnk3EJ.png) both in editor and on Android, along with capping the game's framerate. I have been unable to find any new settings relating to vsync or reasons this could be happening. If anybody could point me in the right direction it would be very helpful. Thank you very much!
Viewing all 853 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>