Editor Loop delay. Is it a problem for my game? - unity3d

I'm new on that thing of analisys profile of Unity. I decided to see if my player is dropping too much FPS and the I found this. Will that be a problem for my game? I don't know how that system works, but I guess 8.35 is a high number...

Not its not.
The editor loop is how long the unity editor took.
The player loop is (roughly) the performance of your game. And the big green part looks like the WaitForTargetFPS call to me. Though to tell for sure you'd have to expand the player loop and see.
If you want to measure the actual performance of your game accurately you have to make a development build and profile that one (you can select the debugging options for this in the build dialog).
Further reading: profiler documentation

Related

Unity Animator Checking Too Slow

I'm currently just trying to learn to use the animator within Unity, I'm very in-exp at animation and don't understand it even in the editor as I focus on programming/scripting.
I have an animation and the states for the animations as-well as the conditions all working perfectly however the animation check for the next state is way to slow. I've tried changing the speed of the actual state but it speeds the animation up and makes it look like my character is walking insanely fast.
I've tried messing around with the frames, making them over a longer time period and making the speed of the state faster however it seems to counter act each other, when I make it longer frames the pace of the animation is slow and then when I make the speed of the state go quicker it just makes the frames tick faster making the animation faster.
What I believe is happening is that the check for the next state of animation is happening once the full animation has been played. However what I need is the check to be happening constantly (as if frame by frame of the unity game not the animation).
Any advice would be great, I've tried using youtube to solve this before coming here however most people are creating a platformer game where as I'm trying to aim for a top down 2d, all directional character movement instead of the linear x axis character movement., and outside libraries.
I deeply apologise for my inability to find a suitable source. I have literally just came across an article online that came across a simple solution.
here:https://answers.unity.com/questions/221601/slow-animation-response.html
basically if you can't be bothered to click the link and you are having the same problem,
find exit-time by clicking the transition and then in the inspector and untick it.
Sorry.

Unity 2D - low fps in editor, 60+ fps in build

we are developing platformer game in Unity engine. Currently in our scene are 15 npc, movement is animation based, they are navigated via scripts, they can talk to player, fight etc. Rigid body does not handle collisions, it just detects ground as a trigger. When build is created, all is nice and smooth 60fps, in editor it is 25 to 30, sometimes a lot lower which makes us sometimes a lot of problems. Do you have any experience how to make a game run smooth in editor? Thank you
if your editor is very slow you can go to the unity icon right click on it and select properties and in the target add -force-opengl in the end.
you can also increment the fps by
void Start()
{
//increase of fps
Application.targetFrameRate = 300;
}
for more info go to https://docs.unity3d.com/ScriptReference/Application-targetFrameRate.html
try to logout to unity becuase sometimes the login can make the editor running slow
Two top things are check that the profiler is not running and that the scene view is not open. These are the two most common causes (in my experience) of slow down in the editor.
You can also make sure there isn't any light baking going on, shouldn't be for 2D but worth checking.
Another thing to check is any editor only scripts, i.e. namespace UnityEditor.* usages (#if UNITY_EDITOR).
If you want an uncapped frame rate, go to project settings -> quality -> vsync mode, and turn off vsync.
Another option may be to turn off Gsync(Vsync) on your monitor and graphics card control panel
Try using Unity 2022.1.24f1, I get more fps in that build and also you can try using this free asset to get more fps.
https://assetstore.unity.com/packages/tools/utilities/frame-rate-booster-120660

Unity on Xbox One - Camera/Rigidbody Visual Movement Hiccup

This is posted here since this is Xbox specific, but I am also posting this onto the Unity forums.
When testing my Unity game on Xbox One I am getting a very large amount of visual "jitter" from the ball. This is a skeeball game where you control the movement of the ball. Essentially the core of the movement is similar to the Rollerball tutorials. On PC this works fine and there are no perceptible jitters. However, on Xbox, I am seeing this a lot more. The object is travelling large distances with the camera following smoothly behind. None of the other objects or scenery are affected, I actually think the camera itself is moving perfectly. But, the ball itself seems to glitch.
Changing my camera movement to LateUpdate seemed to minimize it the most on the PC, but that doesn't make sense to me since I am still not convinced the camera is the problem.
Any help would be greatly appreciated. Perhaps a quality setting isn't placing nice with the Xbox?
Thanks!
Nick
Keep in mind the clock speed of the CPU on the Xbox is likely much slower than your PC (although there are more cores).
Unity is primarily single threaded, so that could explain the performance difference. Here are some things you can try:
* Make sure you are running the "Master" build on Xbox. The default is "Debug" which is significantly slower.
* It's possible it's something with the physics.
Once you've checked to make sure you aren't running Debug, the next step would be to use the Unity profiler to see where your frame time is being spent, then depending on what the cause is optimize that part.
Here is more information on the system resources:
https://learn.microsoft.com/en-us/windows/uwp/xbox-apps/system-resource-allocation
There is also a great post about the graphics debugger here:
https://tarhik.wordpress.com/2017/09/04/antimatter-instance-dev-log-entry-2-using-microsofts-graphic-debugger/
It looks like switching the RigidBody to use "Extrapolate" instead of "Interpolate" fixed the issue I was seeing. I am not sure if this works for every situation, but for the scale of the levels and the player physics of my game this seemed to do the trick.

Scene takes 20secs to load because of StandaloneInputModule

My main scene is taking 20 secs to load and after running the profiler it points to StandaloneInputModule as what makes it take that time.
I've searched in project for that script but it does not exist, i've only found a StandaloneInput
¿Where can i find this script/reduce this load time?
StandaloneInputModule is in the Event System GameObject that you have in your project and it's the responsable of your input in the game that you are developing :)
The problem is essentially that you may have a ton of world space UI Canvases in your game. Each of these canvases has a "graphics raycaster" script, because I think they're put there automatically when you create a canvas (could be wrong). Just remove all of those graphic raycasting checks on all of those canvases. The event system was having to try to keep track of all of those objects, and thus the "Eventsystem.Update()" was having a really hard time. Getting rid of those "graphic raycaster" scripts freed up a ton of CPU time in my game.
The good news is that the "Event System" script and the "Input module" script are not terrible for performance in and of themselves. This is great news for me, because I thought it was on Unity's end, and it turns out not to be (unless you need a lot of graphic raycaster checks).
Peace!

Unity - Stop When Building

I have finished my game in Unity already.
But whenever I'm trying to build the game, it stops at the point as shown below. Does anyone know the reason why it happens? It always stops at the same point....
It's a problem with baking the lightmaps on your scene.
Unity doesn't like huge objects when it comes to baking lightmaps on them and it can certainly kill the light transport on a build.
You can try to open the Window menu from the main Unity menubar and search for the "Continues baking" checkbox under Lightning and uncheck it.
Or you can just split your bigger objects on your scene which may cause this problem.
Here's a thread detailing the issue a bit.
I've also seen people working around this problem by disabling Global Illumination altogether so that may be a solution for you as well if you are using it and you are willing to give up on that feature.
Edit: Another thread about this sort of thing with a decent solution - not sure why I didn't remember it for first but it's a good idea before trying to split your huge objects to mess with their "Scale In Lightmap" property as well to reduce the lightmaps' size.
You can also try the "Advanced Parameter" options.